package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

final class zkq {
   static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4, int var6) throws Exception {
      ArrayList var7 = new ArrayList();
      zif var8 = var1.v();
      zbcr var9 = var8.z();
      int var10 = var9.getCount();
      int var14 = var1.af();
      int var11;
      zbo var12;
      zbo var13;
      if (var14 == 1) {
         var13 = var8.e();
         var12 = var8.E();
         var11 = var9.e(1);
      } else {
         var13 = var8.g();
         var12 = var8.G();
         var11 = var9.e(2);
      }

      if (var13.k() == 2) {
         return a(var0, var1, var2, var3, var4);
      } else {
         double var15 = var12.n() ? zbuk.e(var12.z()) : var12.z();
         double var17 = var12.n() ? zbuk.e(var12.D()) : var12.D();
         var4 = var12.n() ? zbuk.e(var4) : var4;
         float var19 = 0.0F;
         float var20 = 1.5F;
         zbcp var21 = var8.z().d(var14);
         if (var21 != null) {
            var19 = (float)var21.K() / 100.0F;
            var20 = (float)var21.J() / 100.0F;
         }

         boolean var22 = false;
         int var23 = var6;
         if (var13.p) {
            var23 = (int)var13.z();
         }

         int var50;
         if (!var13.f() && !var8.u()) {
            var50 = var23 - 1;
            if (var50 == 0) {
               var50 = 1;
            }
         } else {
            var50 = var23;
         }

         double var24 = (double)var2.e() / (double)var50;
         int var26 = var9.a(var1, var14, new int[]{14});
         if (var26 == -1) {
            return var7;
         } else {
            int var27 = var1.ai();
            zjf var28 = var1.D();

            for(int var29 = 0; var29 < var28.getCount(); ++var29) {
               zjd var30 = var28.b(var29);
               float var31 = (float)var24 / ((float)var11 - var19 * (float)(var11 - 1) + var20);
               float var32 = var31 * var19;
               float var33 = var31 * var20;
               float var34 = (float)var26 * (var31 - var32);
               float var35 = (float)var24 * (float)var29 + var33 / 2.0F + var34;
               if (!var13.f() && !var8.u()) {
                  var35 -= (float)(var24 / 2.0D);
               }

               if (var13.p()) {
                  var35 = (float)(var2.c() + var2.e()) - var35 - var31;
               } else {
                  var35 += (float)var2.c();
               }

               if (var30 != null && !var30.a()) {
                  double var36 = var30.v();
                  float var38 = (float)((var4 - var36) / (var15 - var17) * (double)var2.f());
                  boolean var39 = false;
                  if (var38 == 0.0F) {
                     var39 = true;
                  }

                  zsp var40 = var1.x();
                  if (var40 != null && var40.d() != 2) {
                     com.aspose.cells.b.a.b.zo var41 = new com.aspose.cells.b.a.b.zo(var35 + var31 / 2.0F, var3);
                     double var42 = 0.0D;
                     double var44 = 0.0D;
                     float var46 = 0.0F;
                     float var47 = 0.0F;
                     if (var40 != null) {
                        switch(var40.g()) {
                        case 0:
                           double var48 = var40.e().size() > var29 ? var40.a(var40.e().get(var29)) : 0.0D;
                           var42 = var48;
                           var48 = var40.f().size() > var29 ? var40.a(var40.f().get(var29)) : 0.0D;
                           var44 = var48;
                           break;
                        case 1:
                           var42 = var40.c();
                           var44 = var42;
                           break;
                        case 2:
                           var42 = var40.c() * var36 / 100.0D;
                           var44 = -var42;
                        }

                        var46 = (float)var42 / (float)(var15 - var17) * (float)var2.f();
                        var47 = (float)var44 / (float)(var15 - var17) * (float)var2.f();
                        if (!var12.p()) {
                           var41.b(var41.e() + var38);
                        } else {
                           var41.b(var41.e() - var38);
                        }
                     }

                     var40.a(var41, var46, var47);
                  }

                  float var51 = var3;
                  if (!var12.p()) {
                     if (var38 < 0.0F) {
                        var38 = -var38;
                        var51 = var3 - var38;
                     }
                  } else if (var38 < 0.0F) {
                     var38 = -var38;
                  } else {
                     var51 = var3 - var38;
                  }

                  com.aspose.cells.b.a.b.zq var52 = new com.aspose.cells.b.a.b.zq(var35, var51, var31, var38 + 1.0F);
                  com.aspose.cells.b.a.b.zq var43 = new com.aspose.cells.b.a.b.zq(var52.f(), var52.g(), var52.h(), var52.i());
                  if (var52.g() < (float)var2.d()) {
                     var52.d(var52.i() - ((float)var2.d() - var52.g()));
                     var52.b((float)var2.d());
                  }

                  if (var52.m() > (float)(var2.j() + 1)) {
                     var52.d(var52.i() - (var52.m() - (float)var2.j()));
                  }

                  if (var52.l() >= (float)var2.c() && var52.j() <= (float)var2.i()) {
                     if (var52.f() < (float)var2.c()) {
                        var52.c(var52.h() - ((float)var2.c() - var52.f()));
                        var52.a((float)var2.c());
                     } else if (var52.l() > (float)var2.i()) {
                        var52.c(var52.h() - (var52.l() - (float)var2.i()));
                     }

                     if (var52.h() + 1.0F >= (var31 - 1.0F) / 3.0F) {
                        if (!var39) {
                           a(var0, var30, var52, var8.g(var1.aw()).a(var27), var3, var12);
                        }

                        Object[] var53 = new Object[5];
                        boolean var45;
                        if (var43.g() + (var43.i() - 1.0F) / 2.0F < var3) {
                           var45 = true;
                        } else if (var36 != 0.0D) {
                           var45 = false;
                        } else if (var12.p()) {
                           var45 = false;
                        } else {
                           var45 = true;
                        }

                        var53[0] = var27;
                        var53[1] = var29;
                        var53[2] = var43;
                        var53[3] = var13;
                        var53[4] = var45;
                        com.aspose.cells.b.a.a.ze.a(var7, (Object)var53);
                     }
                  }
               }
            }

            return var7;
         }
      }
   }

   private static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4) throws Exception {
      zif var6 = var1.v();
      int var7 = var6.z().getCount();
      zbcr var8 = var6.z();
      int var10 = var1.af();
      float var11 = 0.0F;
      float var12 = 1.5F;
      zbcp var13 = var6.z().d(var10);
      if (var13 != null) {
         var11 = (float)var13.K() / 100.0F;
         var12 = (float)var13.J() / 100.0F;
      }

      int var9;
      zbo var14;
      zbo var15;
      ArrayList var16;
      if (var10 == 1) {
         var14 = var6.e();
         var15 = var6.E();
         var9 = var8.e(1);
         var16 = zhz.a((List)var6.z().c(), var1.v().S());
      } else {
         var14 = var6.g();
         var15 = var6.G();
         var9 = var8.e(2);
         var16 = zhz.a((List)var6.z().d(), var1.v().S());
      }

      double var17 = var15.n() ? zbuk.e(var15.z()) : var15.z();
      double var19 = var15.n() ? zbuk.e(var15.D()) : var15.D();
      var4 = var15.n() ? zbuk.e(var4) : var4;
      ArrayList var21 = new ArrayList();
      int var22 = var16.size();
      int var23 = var14.j();
      int var24 = (int)var14.D();
      int var25 = (int)var14.z();
      boolean var26 = false;
      int var54;
      if (!var14.f() && !var6.u()) {
         var54 = zbq.a(var23, var25, var24, var1.v().S());
         if (var54 == 0) {
            var54 = 1;
         }
      } else {
         var54 = zbq.a(var23, var25, var24, var1.v().S()) + 1;
      }

      double var27 = (double)var2.e() / (double)var54;

      for(int var29 = 0; var29 < var22; ++var29) {
         zjd var30 = var1.D().b(var29);
         float var31 = (float)(var27 / (double)((float)var9 - var11 * (float)(var9 - 1) + var12));
         float var32 = var31 * var11;
         float var33 = var31 * var12;
         int var34 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var16.get(var29)));
         var34 = zbq.a(var23, var34, var1.v().S());
         int var35 = zbq.a(var23, var34, var24, var1.v().S());
         float var36 = (float)(var27 * (double)var35);
         if (!var14.f() && !var6.u()) {
            var36 -= (float)(var27 / 2.0D);
         }

         float var37 = 0.0F;
         if (var14.p()) {
            var37 = (float)(var2.c() + var2.e()) - var36 - var33 / 2.0F - var31 - 1.0F;
         } else {
            var37 = (float)var2.c() + var36 + var33 / 2.0F + 1.0F;
         }

         int var38 = var8.a(var1, var10, new int[]{14});
         if (var38 == -1) {
            return var21;
         }

         int var39 = var1.ai();
         if (var14.p()) {
            var37 -= (float)var38 * (var31 - var32);
         } else {
            var37 += (float)var38 * (var31 - var32);
         }

         if (var30 != null && !var30.a()) {
            double var40 = var30.v();
            float var42 = (float)((var4 - var40) / (var17 - var19) * (double)var2.f());
            boolean var43 = false;
            if (var42 == 0.0F) {
               var43 = true;
            }

            zsp var44 = var1.x();
            if (var44 != null && var44.d() != 2) {
               com.aspose.cells.b.a.b.zo var45 = new com.aspose.cells.b.a.b.zo(var37 + var31 / 2.0F, var3);
               double var46 = 0.0D;
               double var48 = 0.0D;
               float var50 = 0.0F;
               float var51 = 0.0F;
               if (var44 != null) {
                  switch(var44.g()) {
                  case 0:
                     double var52 = var44.e().size() > var29 ? var44.a(var44.e().get(var29)) : 0.0D;
                     var46 = var52;
                     var52 = var44.f().size() > var29 ? var44.a(var44.f().get(var29)) : 0.0D;
                     var48 = var52;
                     break;
                  case 1:
                     var46 = var44.c();
                     var48 = var46;
                     break;
                  case 2:
                     var46 = var44.c() * var40 / 100.0D;
                     var48 = -var46;
                  }

                  var50 = (float)var46 / (float)(var17 - var19) * (float)var2.f();
                  var51 = (float)var48 / (float)(var17 - var19) * (float)var2.f();
                  if (!var15.p()) {
                     var45.b(var45.e() + var42);
                  } else {
                     var45.b(var45.e() - var42);
                  }
               }

               var44.a(var45, var50, var51);
            }

            float var55 = var3;
            if (!var15.p()) {
               if (var42 < 0.0F) {
                  var42 = -var42;
                  var55 = var3 - var42;
               }
            } else if (var42 < 0.0F) {
               var42 = -var42;
            } else {
               var55 = var3 - var42;
            }

            com.aspose.cells.b.a.b.zq var56 = new com.aspose.cells.b.a.b.zq(var37, var55, var31, var42 + 1.0F);
            com.aspose.cells.b.a.b.zq var47 = new com.aspose.cells.b.a.b.zq(var56.f(), var56.g(), var56.h(), var56.i());
            if (var56.g() < (float)var2.d()) {
               var56.d(var56.i() - ((float)var2.d() - var56.g()));
               var56.b((float)var2.d());
            }

            if (var56.m() > (float)(var2.j() + 1)) {
               var56.d(var56.i() - (var56.m() - (float)var2.j()));
            }

            if (var56.l() >= (float)var2.c() && var56.j() <= (float)var2.i()) {
               if (var56.f() < (float)var2.c()) {
                  var56.c(var56.h() - ((float)var2.c() - var56.f()));
                  var56.a((float)var2.c());
               } else if (var56.l() > (float)var2.i()) {
                  var56.c(var56.h() - (var56.l() - (float)var2.i()));
               }

               if (var56.h() + 1.0F >= (var31 - 1.0F) / 3.0F) {
                  if (!var43) {
                     a(var0, var30, var56, var6.g(var1.aw()).a(var39), var3, var15);
                  }

                  Object[] var57 = new Object[5];
                  boolean var49;
                  if (var47.g() < var3) {
                     var49 = true;
                  } else if (var40 != 0.0D) {
                     var49 = false;
                  } else if (var15.p()) {
                     var49 = false;
                  } else {
                     var49 = true;
                  }

                  var57[0] = var39;
                  var57[1] = var29;
                  var57[2] = var47;
                  var57[3] = var14;
                  var57[4] = var49;
                  com.aspose.cells.b.a.a.ze.a(var21, (Object)var57);
               }
            }
         }
      }

      return var21;
   }

   private static void a(zn var0, zjd var1, com.aspose.cells.b.a.b.zq var2, Color var3, float var4, zbo var5) {
      if (var1.i().h() != 0 || var1.k().e()) {
         var1.a(new com.aspose.cells.b.a.b.zq(var2.f(), var2.g(), var2.h(), var2.i()));
      }

      if (var2.h() < 10.0F) {
         var2.a((float)((int)var2.f()));
      }

      boolean var6 = var1.g().a().A().a();
      if (!var1.i().a) {
         var6 = var1.i().a();
      }

      boolean var7 = false;
      if (var2.m() - 2.0F > var4 && var6 && !var5.p() || var2.g() + 2.0F < var4 && var6 && var5.p()) {
         var7 = true;
      }

      if (var1.i().h() != 0) {
         com.aspose.cells.b.a.b.zc var8 = zax.a(var1.i(), var2, var7);

         try {
            var2.b(var2.g() - 0.5F);
            var0.b(var8, var2);
         } finally {
            if (var8 != null) {
               var8.f();
            }

         }
      }

      if (var2.g() + var2.i() / 2.0F < var4 && var2.m() > var4 && (double)var2.i() > var1.k().b().a() / 2.0D) {
         var2.d(var2.i() - (float)var1.k().b().a() / 2.0F);
      }

      zama.a(var0, var2, var1.k());
      boolean var20 = false;
      if (var2.m() - 2.0F < var4) {
         var20 = true;
      }

      if (var1.F() && (var1.i().h() != 0 || var1.k().c() != 0)) {
         com.aspose.cells.b.a.b.zm var9 = new com.aspose.cells.b.a.b.zm(Color.getBlack(), 2.0F);

         try {
            byte var10 = 2;
            byte var11 = 1;
            com.aspose.cells.b.a.b.a.ze var12 = new com.aspose.cells.b.a.b.a.ze();
            var12.b(var2.l() + (float)var11, var2.g() + (float)var10, var2.l() + (float)var11, var2.m() + (float)var11);
            if (!var20) {
               var12.b(var2.f() + (float)var10, var2.m() + (float)var11, var2.l() + (float)var11, var2.m() + (float)var11);
            }

            var0.a(var9, var12);
         } finally {
            if (var9 != null) {
               var9.r();
            }

         }
      }

   }

   private static void a(zn var0, ziw var1, com.aspose.cells.b.a.b.zq var2) {
      if (var1.d().h() != 0) {
         com.aspose.cells.b.a.b.zc var3 = zax.a(var1.d(), var2);

         try {
            var0.b(var3, var2);
         } finally {
            if (var3 != null) {
               var3.f();
            }

         }
      }

      if (var1.f().e()) {
         if ((double)var2.h() > var1.f().b().a() / 2.0D) {
            var2.c(var2.h() - (float)var1.f().b().a() / 2.0F);
         }

         if (var2.i() < 1.0F) {
            var2.d(1.0F);
         }

         zama.a(var0, var2, var1.f());
      }

   }

   static void a(zn var0, zif var1, ArrayList var2) throws Exception {
      for(int var3 = 0; var3 < var2.size(); ++var3) {
         Object[] var4 = (Object[])((Object[])var2.get(var3));
         int var5 = (Integer)var4[0];
         int var6 = (Integer)var4[1];
         com.aspose.cells.b.a.b.zq var7 = (com.aspose.cells.b.a.b.zq)var4[2];
         zbo var8 = (zbo)var4[3];
         boolean var9 = (Boolean)var4[4];
         int var10 = (int)((float)var1.a() * 0.2F);
         a(var0, var8, var5, var6, var7, var9, var10);
      }

   }

   private static void a(zn var0, zbo var1, int var2, int var3, com.aspose.cells.b.a.b.zq var4, boolean var5, int var6) throws Exception {
      zbcr var7 = var1.c().z();
      zjd var8 = var7.c(var2).D().b(var3);
      zpt var9 = var8.o();
      com.aspose.cells.b.a.b.zt var10 = zpv.a(var0, var1, var7, var2, var3, var6);
      float var11 = var4.f() + var4.h() / 2.0F - var10.b() / 2.0F;
      float var12 = 0.0F;
      boolean var13 = false;
      boolean var14 = false;
      int var15 = var9.j();
      if (var15 == 9) {
         var15 = zpv.b(var7.a(var2).m());
      }

      byte var19;
      byte var21;
      switch(var15) {
      case 1:
         var12 = var4.g() + var4.i() / 2.0F - var10.c() / 2.0F;
         break;
      case 2:
         if (var5) {
            var12 = var4.g() + var4.i() - var10.c();
            var19 = -1;
            var12 += (float)var19;
         } else {
            var12 = var4.g();
            var21 = 5;
            var12 += (float)var21;
         }
         break;
      case 3:
         if (var5) {
            var12 = var4.g();
            byte var18 = 5;
            var12 += (float)var18;
         } else {
            var12 = var4.g() + var4.i() - var10.c();
            byte var20 = -1;
            var12 += (float)var20;
         }
         break;
      default:
         if (var5) {
            var12 = var4.g() - var10.c();
            var19 = -1;
            var12 += (float)var19;
         } else {
            var12 = var4.g() + var4.i();
            var21 = 5;
            var12 += (float)var21;
         }
      }

      if (var7.c(var2).a(new int[]{14})) {
         if (var5) {
            if (var12 + (float)zpv.a + var10.c() > var4.m()) {
               var12 -= var12 + (float)zpv.a + var10.c() - var4.m();
            }
         } else if (var12 < var4.g()) {
            var12 += var4.g() - var12;
         }
      }

      var9.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var11), zbuk.c((double)var12), zbuk.a((double)var10.b()), zbuk.a((double)var10.c()));
      var9.a().z();
      boolean var16 = false;
      com.aspose.cells.b.a.b.zo var17 = new com.aspose.cells.b.a.b.zo((float)(var9.a().a.c() + var9.a().a.e()), (float)(var9.a().a.d() + var9.a().a.f()));
      if (var17.d() < 0.0F || var17.d() > (float)var1.c().a() || var17.e() < 0.0F || var17.e() > (float)var1.c().b()) {
         var16 = true;
      }

      if (!var16) {
         zpv.a(var0, var1, var7, var2, var3, var9.a().a);
      }

   }

   static void a(zn var0, zbcp var1, List var2, com.aspose.cells.b.a.b.zm var3, com.aspose.cells.b.a.b.zp var4) {
      com.aspose.cells.b.a.b.a.zf var5 = var0.e();
      com.aspose.cells.b.a.b.zq var6 = var0.f();
      var0.a(var4);
      boolean var7 = false;
      if (var1.m() == 39 || var1.m() == 42 || var1.m() == 38 || var1.m() == 41) {
         var7 = true;
      }

      com.aspose.cells.b.a.b.zo var9;
      zjd var10;
      for(int var8 = 0; var8 < var2.size(); ++var8) {
         if (var2.get(var8) != null) {
            var9 = (com.aspose.cells.b.a.b.zo)var2.get(var8);
            var10 = var1.D().b(var8);
            if (var10 != null) {
               var10.a(new com.aspose.cells.b.a.b.zq(var9.d(), var9.e(), 0.0F, 0.0F));
            }

            if (zama.a(new com.aspose.cells.b.a.b.zo(var9.d() / 10.0F, var9.e() / 10.0F), var6)) {
               var2.add(var8, (Object)null);
            }
         }
      }

      int var12;
      zjd var13;
      if (var1.E()) {
         if (var2.size() > 1) {
            Object var17 = var2.get(0);
            ArrayList var19 = new ArrayList();
            int var21 = 0;
            ArrayList var11 = new ArrayList();

            for(var12 = 0; var12 < var2.size(); ++var12) {
               var13 = var1.D().b(var12);
               if (var12 == var2.size() - 1 && (var1.m() == 57 || var1.m() == 58)) {
                  var13 = var1.D().b(0);
               }

               if (var13 == null) {
                  if (var19.size() > 1) {
                     a(var0, var3, var19, var4, var21, var12, var11, var1);
                  }

                  var19.clear();
                  var11.clear();
               } else if (var13 != null && !var7 && (var13.d() || var13.H() || var13.c())) {
                  com.aspose.cells.b.a.a.ze.a(var11, (Object)var12);
               } else if (var2.get(var12) != null) {
                  com.aspose.cells.b.a.b.zo var14 = (com.aspose.cells.b.a.b.zo)var2.get(var12);
                  if (var19.size() > 1) {
                     com.aspose.cells.b.a.b.zo var15 = (com.aspose.cells.b.a.b.zo)var19.get(var19.size() - 1);
                     if (Math.abs(var15.d() - var14.d()) < 0.5F && Math.abs(var15.e() - var14.e()) < 0.5F) {
                        a(var0, var3, var19, var4, var21, var12, var11, var1);
                        var19.clear();
                        com.aspose.cells.b.a.a.ze.a(var19, (Object)var14);
                        continue;
                     }
                  }

                  com.aspose.cells.b.a.a.ze.a(var19, (Object)var14);
                  if (var19.size() == 1) {
                     var21 = var12;
                  }
               } else {
                  if (var19.size() > 1) {
                     a(var0, var3, var19, var4, var21, var12, var11, var1);
                  }

                  var19.clear();
                  var11.clear();
               }
            }

            if (var19.size() > 1) {
               a(var0, var3, var19, var4, var21, var2.size() - 1, var11, var1);
            }
         }
      } else if (var2.size() > 1) {
         ArrayList var18 = new ArrayList();
         var9 = null;
         var10 = null;
         boolean var22 = false;

         int var23;
         for(var12 = 0; var12 < var2.size(); ++var12) {
            var13 = var1.D().b(var12);
            if (var13 == null || var7 || !var13.d() && !var13.H() && !var13.c()) {
               Object var20 = var2.get(var12);
               if (var20 == null || ((com.aspose.cells.b.a.b.zo)var20).d() >= 0.0F) {
                  var10 = var13;
                  if (var20 != null) {
                     com.aspose.cells.b.a.a.ze.a(var18, var20);
                  }

                  var23 = var12 + 1;
                  break;
               }
            }
         }

         for(var23 = 1; var23 < var2.size(); ++var23) {
            Object var24 = var2.get(var23);
            var13 = var1.D().b(var23);
            if (var23 == var2.size() - 1 && (var1.m() == 57 || var1.m() == 58)) {
               var13 = var1.D().b(0);
            }

            if ((var13 == null || var7 || !var13.d() && !var13.H() && !var13.c()) && (var24 == null || ((com.aspose.cells.b.a.b.zo)var24).d() >= 0.0F)) {
               com.aspose.cells.b.a.b.zo[] var26;
               if (var13 != null && var24 != null) {
                  if (!var10.k().a(var13.k()) && var18.size() > 1) {
                     new com.aspose.cells.b.a.b.a.ze();
                     var26 = a((List)var18);
                     a(var0, var26, var10);
                     var10 = var13;
                     com.aspose.cells.b.a.b.zo var16 = (com.aspose.cells.b.a.b.zo)var18.get(var18.size() - 1);
                     var18.clear();
                     if (var24 != null) {
                        com.aspose.cells.b.a.a.ze.a(var18, (Object)var16);
                        com.aspose.cells.b.a.a.ze.a(var18, var24);
                        continue;
                     }
                  }

                  if (var24 != null) {
                     com.aspose.cells.b.a.a.ze.a(var18, var24);
                  }

                  var10 = var13;
               } else {
                  if (var18.size() > 1) {
                     new com.aspose.cells.b.a.b.a.ze();
                     var26 = a((List)var18);
                     a(var0, var26, var10);
                  }

                  var18.clear();
                  var10 = var13;
               }
            }
         }

         if (var18.size() > 1) {
            new com.aspose.cells.b.a.b.a.ze();
            com.aspose.cells.b.a.b.zo[] var25 = a((List)var18);
            a(var0, var25, var10);
         }
      }

      var0.a(var5);
   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zm var1, List var2, com.aspose.cells.b.a.b.zp var3, int var4, int var5, ArrayList var6, zbcp var7) {
      float var8 = 0.3F;
      float var9 = 0.5F;
      byte var10 = 3;
      if (var2.size() < var10) {
         com.aspose.cells.b.a.b.zo[] var11 = a(var2);
         if (!var7.H()) {
            var0.a(var1, var11, var9);
         } else {
            a(var0, var7.D(), var11, var9, var4, var5, var6);
         }
      } else {
         ArrayList var27 = new ArrayList();
         boolean var12 = false;
         boolean var13 = false;
         var5 = var4;

         for(int var17 = 0; var17 < var2.size(); ++var17) {
            com.aspose.cells.b.a.b.zo var18 = (com.aspose.cells.b.a.b.zo)var2.get(var17);
            com.aspose.cells.b.a.a.ze.a(var27, (Object)var18);
            if (var27.size() == 1) {
               var4 = var5;
            } else {
               ++var5;

               while(var6.contains(var5)) {
                  ++var5;
               }
            }

            if (var27.size() >= 3) {
               com.aspose.cells.b.a.b.zo var19 = (com.aspose.cells.b.a.b.zo)var27.get(var27.size() - 3);
               com.aspose.cells.b.a.b.zo var20 = (com.aspose.cells.b.a.b.zo)var27.get(var27.size() - 2);
               float var21 = (var20.e() - var19.e()) / (var20.d() - var19.d());
               float var22 = (var18.e() - var20.e()) / (var18.d() - var20.d());
               float var23 = var20.e() - var19.e();
               float var24 = var18.e() - var20.e();
               double var25 = (double)Math.abs(Math.abs(var22) - Math.abs(var21));
               if (Math.abs(var22) < 2.0F || var24 / var23 < 8.0F) {
                  continue;
               }
            }

            boolean var29 = zama.a(var18, var3);
            if (var29) {
               if (var13) {
                  int var30 = var27.size() - 1 - 1;
                  ++var17;

                  while(var17 < var2.size()) {
                     com.aspose.cells.b.a.b.zo var31 = (com.aspose.cells.b.a.b.zo)var2.get(var17);
                     boolean var33 = zama.a(var31, var3);
                     if (!var33) {
                        break;
                     }

                     com.aspose.cells.b.a.a.ze.a(var27, (Object)var31);
                     ++var17;
                  }

                  --var17;
                  if (var27.size() != 2 && var30 != 0) {
                     if (var27.size() > 2) {
                        com.aspose.cells.b.a.b.zo[] var32 = a(var27, 0, var30);
                        if (!var7.H()) {
                           var0.a(var1, var32, var9);
                        } else {
                           a(var0, var7.D(), var32, var9, var4, var4 + var30, var6);
                        }

                        a(var0, var1, a(var27, var30, var27.size() - 1), var8, var4 + var30, var5, var6, var7);
                        var27.clear();
                        com.aspose.cells.b.a.a.ze.a(var27, (Object)var18);
                        var4 = var5;
                        var12 = false;
                        var13 = false;
                     }
                  } else {
                     a(var0, var1, a((List)var27), var8, var4, var5, var6, var7);
                     var27.clear();
                     com.aspose.cells.b.a.a.ze.a(var27, (Object)var18);
                     var4 = var5;
                     var12 = false;
                     var13 = false;
                  }
               }
            } else if (var12) {
               a(var0, var1, a((List)var27), var8, var4, var5, var6, var7);
               var27.clear();
               com.aspose.cells.b.a.a.ze.a(var27, (Object)var18);
               var4 = var5;
               var12 = false;
               var13 = false;
            }

            if (var29) {
               var12 = true;
            } else {
               var13 = true;
            }
         }

         if (var27.size() > 1) {
            if (var12) {
               a(var0, var1, a((List)var27), var8, var4, var5, var6, var7);
            } else {
               com.aspose.cells.b.a.b.zo[] var28 = a((List)var27);
               if (!var7.H()) {
                  var0.a(var1, var28, var9);
               } else {
                  a(var0, var7.D(), var28, var9, var4, var5, var6);
               }
            }
         }
      }

   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zm var1, com.aspose.cells.b.a.b.zo[] var2, float var3, int var4, int var5, ArrayList var6, zbcp var7) {
      float var8 = 0.0F;
      float var9 = 0.0F;
      float var10 = 0.0F;
      float var11 = 0.0F;

      int var12;
      for(var12 = 0; var12 < var2.length; ++var12) {
         if (var12 == 0) {
            var8 = var2[var12].d();
            var9 = var8;
            var10 = var2[var12].e();
            var11 = var10;
         } else {
            if (var2[var12].d() < var8) {
               var8 = var2[var12].d();
            }

            if (var2[var12].d() > var9) {
               var9 = var2[var12].d();
            }

            if (var2[var12].e() < var10) {
               var10 = var2[var12].e();
            }

            if (var2[var12].e() > var11) {
               var11 = var2[var12].e();
            }
         }
      }

      var12 = zbuk.h((double)(var9 - var8));
      int var13 = zbuk.h((double)(var11 - var10));
      int var14 = var12 > var13 ? var12 : var13;
      if (var14 > 4) {
         var3 *= (float)Math.pow(10.0D, (double)(4 - var14));
      }

      if (!var7.H()) {
         var0.a(var1, var2, var3);
      } else {
         a(var0, var7.D(), var2, var3, var4, var5, var6);
      }

   }

   private static void a(zn var0, zjf var1, com.aspose.cells.b.a.b.zo[] var2, float var3, int var4, int var5, ArrayList var6) {
      int var7 = 0;

      for(int var8 = var4 + 1; var8 <= var5; ++var8) {
         if (!var6.contains(var8) && var8 < var1.getCount()) {
            zjd var9 = var1.b(var8);
            if (var9 != null) {
               com.aspose.cells.b.a.b.zm var10 = zama.a(var9.k());

               try {
                  if (var7 < var2.length - 1) {
                     var0.a(var10, var2, var7, 1, var3);
                  }

                  ++var7;
               } finally {
                  if (var10 != null) {
                     var10.r();
                  }

               }
            }
         }
      }

   }

   private static com.aspose.cells.b.a.b.zo[] a(List var0) {
      com.aspose.cells.b.a.b.zo[] var1 = new com.aspose.cells.b.a.b.zo[var0.size()];
      zbuk.a(var1);

      for(int var2 = 0; var2 < var0.size(); ++var2) {
         var1[var2] = (com.aspose.cells.b.a.b.zo)var0.get(var2);
      }

      return var1;
   }

   private static com.aspose.cells.b.a.b.zo[] a(List var0, int var1, int var2) {
      com.aspose.cells.b.a.b.zo[] var3 = new com.aspose.cells.b.a.b.zo[var2 - var1 + 1];
      zbuk.a(var3);

      for(int var4 = var1; var4 <= var2; ++var4) {
         var3[var4 - var1] = (com.aspose.cells.b.a.b.zo)var0.get(var4);
      }

      return var3;
   }

   private static void a(zn var0, com.aspose.cells.b.a.b.zo[] var1, zjd var2) {
      if (var1.length < 3) {
         zama.a(var0, var1[0], var1[1], var2.k());
      } else {
         com.aspose.cells.b.a.b.zo[][] var3 = new com.aspose.cells.b.a.b.zo[][]{var1};
         a(var3);
         var1 = var3[0];
         ArrayList var4 = new ArrayList();
         com.aspose.cells.b.a.b.zo var5 = var1[0];
         com.aspose.cells.b.a.b.zo var6 = var1[1];
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var5);
         com.aspose.cells.b.a.a.ze.a(var4, (Object)var6);

         for(int var7 = 2; var7 < var1.length; ++var7) {
            com.aspose.cells.b.a.b.zo var8 = var1[var7];
            double var9 = a(var5, var6, var8);
            var9 = var9 * 180.0D / 3.141592653589793D;
            if (var9 < 30.0D) {
               a(var0, var4, var2);
               zama.a(var0, var6, var8, var2.k());
               var5 = var6;
               var6 = var8;
               var4.clear();
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var5);
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var8);
            } else {
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var8);
               var5 = var6;
               var6 = var8;
            }
         }

         if (var4.size() > 1) {
            a(var0, var4, var2);
         }
      }

   }

   private static double a(com.aspose.cells.b.a.b.zo var0, com.aspose.cells.b.a.b.zo var1, com.aspose.cells.b.a.b.zo var2) {
      double var3 = Math.sqrt(Math.pow((double)(var1.e() - var0.e()), 2.0D) + Math.pow((double)(var1.d() - var0.d()), 2.0D));
      double var5 = Math.sqrt(Math.pow((double)(var2.e() - var1.e()), 2.0D) + Math.pow((double)(var2.d() - var1.d()), 2.0D));
      double var7 = Math.sqrt(Math.pow((double)(var2.e() - var0.e()), 2.0D) + Math.pow((double)(var2.d() - var0.d()), 2.0D));
      double var9 = (Math.pow(var3, 2.0D) + Math.pow(var5, 2.0D) - Math.pow(var7, 2.0D)) / (2.0D * var3 * var5);
      return Math.acos(var9);
   }

   private static void a(zn var0, ArrayList var1, zjd var2) {
      if (var1.size() == 2) {
         zama.a(var0, (com.aspose.cells.b.a.b.zo)var1.get(0), (com.aspose.cells.b.a.b.zo)var1.get(1), var2.k());
      } else {
         com.aspose.cells.b.a.b.a.ze var3 = new com.aspose.cells.b.a.b.a.ze();
         com.aspose.cells.b.a.b.zo[] var4 = a((List)var1);
         var3.a(var4);
         com.aspose.cells.b.a.b.zm var5 = zama.a(var2.k());

         try {
            var0.a(var5, var3);
            var5.a();
         } finally {
            if (var5 != null) {
               var5.r();
            }

         }
      }

   }

   private static void a(com.aspose.cells.b.a.b.zo[][] var0) {
      com.aspose.cells.b.a.b.zo var1 = com.aspose.cells.b.a.b.zo.a();
      if (var0[0].length > 0) {
         var1 = var0[0][0];
      }

      int var2 = 0;

      for(int var3 = 1; var3 < var0[0].length; ++var3) {
         com.aspose.cells.b.a.b.zo var4 = var0[0][var3];
         if (var0[0].length - var2 <= 2) {
            break;
         }

         if (Math.abs(var1.d() - var4.d()) < 1.0F && Math.abs(var1.e() - var4.e()) < 1.0F) {
            var0[0][var3] = com.aspose.cells.b.a.b.zo.a();
            ++var2;
         } else {
            var1 = var0[0][var3];
         }
      }

      if (var2 > 0) {
         com.aspose.cells.b.a.b.zo[] var6 = new com.aspose.cells.b.a.b.zo[var0[0].length - var2];
         int var7 = 0;

         for(int var5 = 0; var5 < var0[0].length; ++var5) {
            if (!var0[0][var5].b()) {
               var6[var7] = var0[0][var5];
               ++var7;
            }
         }

         var0[0] = var6;
      }

   }

   static void a(zn var0, zbcp var1, List var2, com.aspose.cells.b.a.b.zp var3) {
      var3 = new com.aspose.cells.b.a.b.zp(var3.c(), var3.d(), var3.e(), var3.f());
      var3.a(1, 1);

      for(int var4 = 0; var4 < var2.size(); ++var4) {
         Object var5 = var2.get(var4);
         if (var5 != null) {
            zjd var6 = var1.D().b(var4);
            com.aspose.cells.b.a.b.zo var7 = (com.aspose.cells.b.a.b.zo)var5;
            if (var7.d() >= (float)var3.c() && var7.e() >= (float)var3.d() && var7.d() <= (float)var3.i() && var7.e() <= (float)var3.j() && var6.m().g()) {
               zalc.a(var0, var7.d(), var7.e(), var6.m(), (float)var6.m().c(), false);
            }
         }
      }

   }

   static ArrayList b(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4, int var6) throws Exception {
      ArrayList var7 = new ArrayList();
      zif var8 = var1.v();
      int[] var9 = new int[]{37, 40};
      int var12 = var1.af();
      zbo var10;
      zbo var11;
      if (var12 == 1) {
         var11 = var8.e();
         var10 = var8.E();
      } else {
         var11 = var8.g();
         var10 = var8.G();
      }

      if (var11.k() == 2) {
         return b(var0, var1, var2, var3, (double)((float)var4));
      } else {
         zbcr var13 = var8.z();
         int var14 = var13.getCount();
         float var15 = (float)var1.J() / 100.0F;
         double var16 = var10.n() ? zbuk.e(var10.z()) : var10.z();
         double var18 = var10.n() ? zbuk.e(var10.D()) : var10.D();
         var4 = var10.n() ? zbuk.e(var4) : var4;
         boolean var20 = var1.L();
         zalv var21 = var1.O();
         zalv var22 = var1.P();
         ziw var23 = var1.S();
         ziw var24 = var1.T();
         boolean var25 = false;
         int var26 = var6;
         if (var11.p) {
            var26 = (int)var11.z();
         }

         int var58;
         if (!var11.f() && !var8.u()) {
            var58 = var26 - 1;
            if (var58 == 0) {
               var58 = 1;
            }
         } else {
            var58 = var26;
         }

         double var27 = (double)var2.e() / (double)var58;
         ArrayList var29 = new ArrayList();
         ArrayList var30 = new ArrayList();
         List var31 = var13.a(var12, var9);

         int var32;
         for(var32 = 0; var32 < var31.size(); ++var32) {
            zbcp var33 = (zbcp)var31.get(var32);
            if ((!var8.an() || var33.equals(var1)) && (var1.N() || var1.M() || var33.equals(var1))) {
               int var34 = var33.ai();
               com.aspose.cells.b.a.b.zm var35 = null;
               ArrayList var36 = new ArrayList();
               zjf var37 = var33.D();

               for(int var38 = 0; var38 < var6; ++var38) {
                  zjd var39 = var37.b(var38);
                  if (var39 != null && !var39.a() && !var39.H()) {
                     if (var35 != null) {
                        var35.a();
                     }

                     var35 = zama.a(var39.k());
                     double var40 = (double)((float)var27 * (float)var38 + 1.0F);
                     if (var11.f() || var8.u()) {
                        var40 += (double)((float)(var27 / 2.0D));
                     }

                     if (var11.p()) {
                        var40 = (double)(var2.c() + var2.e()) - var40;
                     } else {
                        var40 += (double)var2.c();
                     }

                     double var42 = (double)var3;
                     double var44 = var39.v();
                     double var46 = (var44 - var4) / (var16 - var18) * (double)var2.f();
                     zsp var48 = var1.x();
                     com.aspose.cells.b.a.b.zo var49;
                     if (var48 != null && var48.d() != 2) {
                        var49 = new com.aspose.cells.b.a.b.zo((float)var40, var3);
                        double var50 = 0.0D;
                        double var52 = 0.0D;
                        float var54 = 0.0F;
                        float var55 = 0.0F;
                        if (var48 != null) {
                           switch(var48.g()) {
                           case 0:
                              double var56 = var48.e().size() > var38 ? var48.a(var48.e().get(var38)) : 0.0D;
                              var50 = var56;
                              var56 = var48.f().size() > var38 ? var48.a(var48.f().get(var38)) : 0.0D;
                              var52 = var56;
                              break;
                           case 1:
                              var50 = var48.c();
                              var52 = var50;
                              break;
                           case 2:
                              var50 = var48.c() * var44 / 100.0D;
                              var52 = -var50;
                           }

                           var54 = (float)var50 / (float)(var16 - var18) * (float)var2.f();
                           var55 = (float)var52 / (float)(var16 - var18) * (float)var2.f();
                           if (!var10.p()) {
                              var49.b(var49.e() - (float)var46);
                           } else {
                              var49.b(var49.e() + (float)var46);
                           }
                        }

                        if (var33.equals(var1)) {
                           var48.a(var49, var54, var55);
                        }
                     }

                     if (!var10.p()) {
                        var42 -= var46;
                     } else {
                        var42 += var46;
                     }

                     var49 = new com.aspose.cells.b.a.b.zo((float)var40, (float)var42);
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)var49);
                     if (var33.equals(var1)) {
                        if (var20) {
                           zama.a(var0, (float)var40, (float)var42, (float)var40, var3, var21);
                        }

                        com.aspose.cells.b.a.a.ze.a(var30, (Object)var49);
                        Object[] var73 = new Object[]{var34, var38, var49, var11};
                        com.aspose.cells.b.a.a.ze.a(var7, (Object)var73);
                     }
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)null);
                     if (var33.equals(var1)) {
                        com.aspose.cells.b.a.a.ze.a(var30, (Object)null);
                     }
                  }
               }

               if (var33.equals(var1)) {
                  if (var35 == null) {
                     var35 = zama.a(var33.z());
                  }

                  a((zn)var0, (zbcp)var1, (List)var36, (com.aspose.cells.b.a.b.zm)var35, (com.aspose.cells.b.a.b.zp)var2);
               }

               if (var35 != null) {
                  var35.a();
               }

               com.aspose.cells.b.a.a.ze.a(var29, (Object)var36);
            }
         }

         for(var32 = 0; var32 < var6; ++var32) {
            boolean var59 = false;
            boolean var60 = false;
            float var62 = 0.0F;
            float var61 = 0.0F;
            float var63 = 0.0F;
            boolean var64 = false;
            boolean var65 = false;
            float var66 = 0.0F;
            float var41 = 0.0F;

            int var67;
            for(var67 = 0; var67 < var29.size(); ++var67) {
               ArrayList var43 = (ArrayList)var29.get(var67);
               if (var43.size() > var32 && var43.get(var32) != null) {
                  com.aspose.cells.b.a.b.zo var71 = (com.aspose.cells.b.a.b.zo)var43.get(var32);
                  var63 = var71.d();
                  if (!var59) {
                     var62 = var71.e();
                     var59 = true;
                  } else if (!var60) {
                     if (var62 < var71.e()) {
                        var61 = var62;
                        var62 = var71.e();
                        var60 = true;
                     } else {
                        var61 = var71.e();
                        var60 = true;
                     }
                  } else {
                     if (var62 < var71.e()) {
                        var62 = var71.e();
                     }

                     if (var61 > var71.e()) {
                        var61 = var71.e();
                     }
                  }

                  if (var67 == 0) {
                     var66 = var71.e();
                     var64 = true;
                  } else if (var67 == var29.size() - 1) {
                     var41 = var71.e();
                     var65 = true;
                  }
               }
            }

            if (var1.M() && var59 && var60) {
               float[] var70 = new float[]{var63};
               float[] var68 = new float[]{var62};
               var70[0] = var63;
               float[] var72 = new float[]{var61};
               boolean var45 = a(var10.X(), var2, var70, var68, var70, var72);
               var63 = var70[0];
               var62 = var68[0];
               var63 = var70[0];
               var61 = var72[0];
               if (var45) {
                  zama.a(var0, var63, var62, var63, var61, var22);
               }
            }

            if (var1.N() && var64 && var65) {
               var67 = (int)(var27 / (double)(1.0F + var15));
               com.aspose.cells.b.a.b.zq var69 = new com.aspose.cells.b.a.b.zq();
               if (var66 <= var41) {
                  var69.c((float)var67);
                  var69.d(var41 - var66);
                  var69.a(var63 - var69.h() / 2.0F);
                  var69.b(var66);
                  a(var0, var24, var69);
               } else {
                  var69.c((float)var67);
                  var69.d(var66 - var41);
                  var69.a(var63 - var69.h() / 2.0F);
                  var69.b(var41);
                  a(var0, var23, var69);
               }
            }
         }

         a(var0, var1, (List)var30, (com.aspose.cells.b.a.b.zp)var2);
         return var7;
      }
   }

   private static boolean a(int var0, com.aspose.cells.b.a.b.zp var1, float[] var2, float[] var3, float[] var4, float[] var5) {
      float var6 = (float)var0 * 1.5F;
      if ((var2[0] + var6 > (float)var1.c() || var4[0] + var6 > (float)var1.c()) && (var2[0] - var6 < (float)var1.i() || var4[0] - var6 < (float)var1.i())) {
         if ((var3[0] + var6 > (float)var1.d() || var5[0] + var6 > (float)var1.d()) && (var3[0] - var6 < (float)var1.j() || var5[0] - var6 < (float)var1.j())) {
            if (var2[0] + var6 < (float)var1.c()) {
               var2[0] = (float)var1.c() - var6;
            }

            if (var2[0] - var6 > (float)var1.i()) {
               var2[0] = (float)var1.i() + var6;
            }

            if (var4[0] + var6 < (float)var1.c()) {
               var4[0] = (float)var1.c() - var6;
            }

            if (var4[0] - var6 > (float)var1.i()) {
               var4[0] = (float)var1.i() + var6;
            }

            if (var3[0] + var6 < (float)var1.d()) {
               var3[0] = (float)var1.d() - var6;
            }

            if (var3[0] - var6 > (float)var1.j()) {
               var3[0] = (float)var1.j() + var6;
            }

            if (var5[0] + var6 < (float)var1.d()) {
               var5[0] = (float)var1.d() - var6;
            }

            if (var5[0] - var6 > (float)var1.j()) {
               var5[0] = (float)var1.j() + var6;
            }

            return true;
         } else {
            return false;
         }
      } else {
         return false;
      }
   }

   static void b(zn var0, zif var1, ArrayList var2) throws Exception {
      for(int var3 = 0; var3 < var2.size(); ++var3) {
         Object[] var4 = (Object[])((Object[])var2.get(var3));
         int var5 = (Integer)var4[0];
         int var6 = (Integer)var4[1];
         com.aspose.cells.b.a.b.zo var7 = (com.aspose.cells.b.a.b.zo)var4[2];
         zbo var8 = (zbo)var4[3];
         int var9 = (int)((float)var1.a() * 0.2F);
         a(var0, var8, var5, var6, var7, var9);
      }

   }

   static void a(zn var0, zbo var1, int var2, int var3, com.aspose.cells.b.a.b.zo var4, int var5) throws Exception {
      zbcr var6 = var1.c().z();
      zbcp var7 = var6.c(var2);
      zjd var8 = var7.D().b(var3);
      zpt var9 = var8.o();
      com.aspose.cells.b.a.b.zt var10 = zpv.a(var0, var1, var6, var2, var3, var5);
      float var11 = 0.0F;
      float var12 = 0.0F;
      float var13 = 4.0F;
      if (var7.m() != 12 && var7.m() != 13) {
         if (var8.m().d() != 1) {
            var13 += (float)((int)((float)var8.m().c() / 2.0F));
         }
      } else {
         var13 += var8.a / 2.0F;
      }

      int var14 = var9.j();
      if (var14 == 9) {
         var14 = zpv.b(var6.a(var2).m());
      }

      switch(var14) {
      case 1:
         var11 = var4.d() - var10.b() / 2.0F;
         var12 = var4.e() - var10.c() / 2.0F;
         break;
      case 2:
      case 3:
      case 4:
      default:
         var11 = var4.d() + var13;
         var12 = var4.e() - var10.c() / 2.0F;
         if (var9.e()) {
            var11 += (float)zpv.a;
         }
         break;
      case 5:
         var11 = var4.d() - var10.b() / 2.0F;
         var12 = var4.e() - var10.c() - var13;
         var12 -= (float)zpv.a;
         break;
      case 6:
         var11 = var4.d() - var10.b() / 2.0F;
         var12 = var4.e() + var13;
         var12 += (float)zpv.a;
         break;
      case 7:
         var11 = var4.d() - var10.b() - var13;
         var12 = var4.e() - var10.c() / 2.0F;
         if (var9.e()) {
            var11 -= (float)zpv.a;
         }
      }

      var9.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var11), zbuk.c((double)var12), zbuk.a((double)var10.b()), zbuk.a((double)var10.c()));
      var9.a().z();
      zpv.a(var0, var1, var6, var2, var3, var9.a().a);
   }

   private static ArrayList b(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3, double var4) throws Exception {
      ArrayList var6 = new ArrayList();
      zif var7 = var1.v();
      int[] var8 = new int[]{37, 40};
      int var9 = var1.af();
      zbcr var10 = var7.z();
      int var11 = var10.getCount();
      float var12 = (float)var1.J() / 100.0F;
      zbo var13;
      zbo var14;
      ArrayList var15;
      if (var9 == 1) {
         var14 = var7.e();
         var13 = var7.E();
         var15 = zhz.a((List)var7.z().c(), var1.v().S());
      } else {
         var14 = var7.g();
         var13 = var7.G();
         var15 = zhz.a((List)var7.z().d(), var1.v().S());
      }

      double var16 = var13.n() ? zbuk.e(var13.z()) : var13.z();
      double var18 = var13.n() ? zbuk.e(var13.D()) : var13.D();
      var4 = var13.n() ? zbuk.e(var4) : var4;
      boolean var20 = var1.L();
      zalv var21 = var1.O();
      zalv var22 = var1.P();
      ziw var23 = var1.S();
      ziw var24 = var1.T();
      int var25 = var15.size();
      int var26 = var14.j();
      int var27 = (int)var14.D();
      int var28 = (int)var14.z();
      boolean var29 = false;
      int var60;
      if (!var14.f() && !var7.u()) {
         var60 = zbq.a(var26, var28, var27, var1.v().S());
         if (var60 == 0) {
            var60 = 1;
         }
      } else {
         var60 = zbq.a(var26, var28, var27, var1.v().S()) + 1;
      }

      double var30 = (double)var2.e() / (double)var60;
      float var32 = 0.0F;
      ArrayList var33 = new ArrayList();
      ArrayList var34 = new ArrayList();
      List var35 = var10.a(var9, var8);

      int var36;
      float var45;
      for(var36 = 0; var36 < var35.size(); ++var36) {
         zbcp var37 = (zbcp)var35.get(var36);
         if ((!var7.an() || var37.equals(var1)) && (var1.N() || var1.M() || var37.equals(var1))) {
            int var38 = var37.ai();
            com.aspose.cells.b.a.b.zm var39 = null;
            ArrayList var40 = new ArrayList();

            for(int var41 = 0; var41 < var25; ++var41) {
               zjd var42 = var37.D().b(var41);
               if (var42 != null && !var42.a() && !var42.H()) {
                  if (var39 != null) {
                     var39.a();
                  }

                  var39 = zama.a(var42.k());
                  int var43 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var15.get(var41)));
                  var43 = zbq.a(var26, var43, var1.v().S());
                  int var44 = zbq.a(var26, var43, var27, var1.v().S());
                  var45 = (float)(var30 * (double)var44);
                  var32 = (float)(var30 * (double)zbq.a(var26, zbq.a(var14.j(), var14.y(), (int)var14.x(), var43, var1.v().S()), var43, var1.v().S()));
                  if (var14.f() || var7.u()) {
                     var45 += (float)(var30 / 2.0D);
                  }

                  float var46 = 0.0F;
                  if (var14.p()) {
                     var46 = (float)(var2.c() + var2.e()) - var45;
                  } else {
                     var46 = (float)var2.c() + var45;
                  }

                  float var48 = (float)var42.v();
                  float var49 = (float)(((double)var48 - var4) / (var16 - var18) * (double)var2.f());
                  zsp var50 = var1.x();
                  com.aspose.cells.b.a.b.zo var51;
                  if (var50 != null && var50.d() != 2) {
                     var51 = new com.aspose.cells.b.a.b.zo(var46, var3);
                     double var52 = 0.0D;
                     double var54 = 0.0D;
                     float var56 = 0.0F;
                     float var57 = 0.0F;
                     if (var50 != null) {
                        switch(var50.g()) {
                        case 0:
                           double var58 = var50.e().size() > var41 ? var50.a(var50.e().get(var41)) : 0.0D;
                           var52 = var58;
                           var58 = var50.f().size() > var41 ? var50.a(var50.f().get(var41)) : 0.0D;
                           var54 = var58;
                           break;
                        case 1:
                           var52 = var50.c();
                           var54 = var52;
                           break;
                        case 2:
                           var52 = var50.c() * (double)var48 / 100.0D;
                           var54 = -var52;
                        }

                        var56 = (float)var52 / (float)(var16 - var18) * (float)var2.f();
                        var57 = (float)var54 / (float)(var16 - var18) * (float)var2.f();
                        if (!var13.p()) {
                           var51.b(var51.e() - var49);
                        } else {
                           var51.b(var51.e() + var49);
                        }
                     }

                     if (var37.equals(var1)) {
                        var50.a(var51, var56, var57);
                     }
                  }

                  float var47;
                  if (!var13.p()) {
                     var47 = var3 - var49;
                  } else {
                     var47 = var3 + var49;
                  }

                  var51 = new com.aspose.cells.b.a.b.zo(var46, var47);
                  if (var40.size() == 0) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var51);
                  } else {
                     a(var51, var40, var14.p());
                  }

                  if (var37.equals(var1)) {
                     if (var20) {
                        zama.a(var0, var46, var47, var46, var3, var21);
                     }

                     com.aspose.cells.b.a.a.ze.a(var34, (Object)var51);
                     Object[] var77 = new Object[]{var38, var41, var51, var14};
                     com.aspose.cells.b.a.a.ze.a(var6, (Object)var77);
                  }
               } else {
                  if (var14.p()) {
                     var40.add(0, (Object)null);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)null);
                  }

                  if (var37.equals(var1)) {
                     com.aspose.cells.b.a.a.ze.a(var34, (Object)null);
                  }
               }
            }

            if (var37.equals(var1)) {
               if (var39 == null) {
                  var39 = zama.a(var37.z());
               }

               a((zn)var0, (zbcp)var1, (List)var40, (com.aspose.cells.b.a.b.zm)var39, (com.aspose.cells.b.a.b.zp)var2);
            }

            if (var39 != null) {
               var39.a();
            }

            com.aspose.cells.b.a.a.ze.a(var33, (Object)var40);
         }
      }

      for(var36 = 0; var36 < var25; ++var36) {
         boolean var61 = false;
         boolean var62 = false;
         float var64 = 0.0F;
         float var63 = 0.0F;
         float var65 = 0.0F;
         boolean var66 = false;
         boolean var67 = false;
         float var68 = 0.0F;
         var45 = 0.0F;

         int var69;
         for(var69 = 0; var69 < var33.size(); ++var69) {
            ArrayList var70 = (ArrayList)var33.get(var69);
            if (var70.size() > var36 && var70.get(var36) != null) {
               com.aspose.cells.b.a.b.zo var73 = (com.aspose.cells.b.a.b.zo)var70.get(var36);
               var65 = var73.d();
               if (!var61) {
                  var64 = var73.e();
                  var61 = true;
               } else if (!var62) {
                  if (var64 < var73.e()) {
                     var63 = var64;
                     var64 = var73.e();
                     var62 = true;
                  } else {
                     var63 = var73.e();
                     var62 = true;
                  }
               } else {
                  if (var64 < var73.e()) {
                     var64 = var73.e();
                  }

                  if (var63 > var73.e()) {
                     var63 = var73.e();
                  }
               }

               if (var69 == 0) {
                  var68 = var73.e();
                  var66 = true;
               } else if (var69 == var11 - 1) {
                  var45 = var73.e();
                  var67 = true;
               }
            }
         }

         if (var1.M() && var61 && var62) {
            float[] var71 = new float[]{var65};
            float[] var72 = new float[]{var64};
            var71[0] = var65;
            float[] var74 = new float[]{var63};
            boolean var76 = a(var13.X(), var2, var71, var72, var71, var74);
            var65 = var71[0];
            var64 = var72[0];
            var65 = var71[0];
            var63 = var74[0];
            if (var76) {
               zama.a(var0, var65, var64, var65, var63, var22);
            }
         }

         if (var1.N() && var66 && var67) {
            var69 = (int)(var32 / (1.0F + var12));
            com.aspose.cells.b.a.b.zq var75 = new com.aspose.cells.b.a.b.zq();
            if (var68 <= var45) {
               var75.c((float)var69);
               var75.d(var45 - var68);
               var75.a(var65 - var75.h() / 2.0F);
               var75.b(var68);
               a(var0, var24, var75);
            } else {
               var75.c((float)var69);
               var75.d(var68 - var45);
               var75.a(var65 - var75.h() / 2.0F);
               var75.b(var45);
               a(var0, var23, var75);
            }
         }
      }

      a(var0, var1, (List)var34, (com.aspose.cells.b.a.b.zp)var2);
      return var6;
   }

   private static void a(com.aspose.cells.b.a.b.zo var0, ArrayList var1, boolean var2) {
      boolean var3 = false;
      int var4;
      com.aspose.cells.b.a.b.zo var5;
      if (var2) {
         for(var4 = 0; var4 <= var1.size() - 1; ++var4) {
            if (var1.get(var4) == null) {
               var1.add(var4, var0);
               var3 = true;
               break;
            }

            var5 = (com.aspose.cells.b.a.b.zo)var1.get(var4);
            if (var0.d() <= var5.d()) {
               var1.add(var4, var0);
               var3 = true;
               break;
            }
         }

         if (!var3) {
            com.aspose.cells.b.a.a.ze.a(var1, (Object)var0);
         }
      } else {
         for(var4 = var1.size() - 1; var4 >= 0; --var4) {
            if (var1.get(var4) == null) {
               if (var4 == var1.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var1, (Object)var0);
               } else {
                  var1.add(var4 + 1, var0);
               }

               var3 = true;
               break;
            }

            var5 = (com.aspose.cells.b.a.b.zo)var1.get(var4);
            if (var0.d() >= var5.d()) {
               if (var4 == var1.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var1, (Object)var0);
               } else {
                  var1.add(var4 + 1, var0);
               }

               var3 = true;
               break;
            }
         }

         if (!var3) {
            var1.add(0, var0);
         }
      }

   }

   static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, int var3) throws Exception {
      zif var4 = var1.v();
      byte var5 = 15;
      zbcr var6 = var4.z();
      int var7 = var6.getCount();
      int var11 = var1.af();
      int var8;
      zbo var9;
      zbo var10;
      if (var11 == 1) {
         var10 = var4.e();
         var9 = var4.E();
         var8 = var6.b(1, var5);
      } else {
         var10 = var4.g();
         var9 = var4.G();
         var8 = var6.b(2, var5);
      }

      if (var10.k() == 2) {
         return a(var0, var1, var2);
      } else {
         double var12 = var9.n() ? zbuk.e(var9.z()) : var9.z();
         double var14 = var9.n() ? zbuk.e(var9.D()) : var9.D();
         float var16 = 0.0F;
         if (!var9.p()) {
            var16 = (float)var2.d() + (float)var12 / (float)(var12 - var14) * (float)var2.f();
         } else {
            var16 = (float)var2.j() - (float)var12 / (float)(var12 - var14) * (float)var2.f();
         }

         float var17 = (float)var1.K() / 100.0F;
         float var18 = (float)var1.J() / 100.0F;
         ArrayList var19 = new ArrayList();
         boolean var20 = false;
         int var21 = var3;
         if (var10.p) {
            var21 = (int)var10.z();
         }

         int var54;
         if (!var10.f() && !var4.u()) {
            var54 = var21 - 1;
            if (var54 == 0) {
               var54 = 1;
            }
         } else {
            var54 = var21;
         }

         double var22 = (double)var2.e() / (double)var54;
         float var24 = 0.0F;
         List var25 = var6.a(var11, new int[]{var5});
         int var26 = var6.a(var1, var11, new int[]{var5});
         if (var26 == -1) {
            return new ArrayList();
         } else {
            int var27 = var1.ai();
            zjf var28 = var1.D();
            ArrayList var29 = new ArrayList();

            for(int var30 = 0; var30 < var28.getCount(); ++var30) {
               zjd var31 = var28.b(var30);
               float var32 = (float)var22 / ((float)var8 - var17 * (float)(var8 - 1) + var18);
               float var33 = var32 * var17;
               float var34 = var32 * var18;
               var24 += (float)var26 * (var32 - var33);
               float var35 = (float)var22 * (float)var30 + var34 / 2.0F + var24;
               if (!var10.f() && !var4.u()) {
                  var35 -= (float)(var22 / 2.0D);
               }

               if (var10.p()) {
                  var35 = (float)(var2.c() + var2.e()) - var35 - var32;
               } else {
                  var35 += (float)var2.c();
               }

               ArrayList var36 = new ArrayList();
               double var37 = var31.v();
               double var39 = var37;
               int var41;
               zjd var42;
               double var43;
               if (var37 >= 0.0D) {
                  for(var41 = 0; var41 < var26; ++var41) {
                     var42 = ((zbcp)var25.get(var41)).D().b(var30);
                     if (var42 != null) {
                        var43 = var42.v();
                        if (var43 > 0.0D) {
                           var39 += var43;
                        }
                     }
                  }
               } else {
                  for(var41 = 0; var41 < var26; ++var41) {
                     var42 = ((zbcp)var25.get(var41)).D().b(var30);
                     if (var42 != null) {
                        var43 = var42.v();
                        if (var43 <= 0.0D) {
                           var39 += var43;
                        }
                     }
                  }
               }

               float var55 = (float)(Math.abs(var37) / (var12 - var14) * (double)var2.f());
               float var56 = (float)(Math.abs(var39) / (var12 - var14) * (double)var2.f());
               boolean var57 = false;
               if (var55 == 0.0F) {
                  var57 = true;
               }

               zsp var44 = var1.x();
               if (var44 != null && var44.d() != 2) {
                  com.aspose.cells.b.a.b.zo var45 = new com.aspose.cells.b.a.b.zo(var35 + var32 / 2.0F, var16);
                  double var46 = 0.0D;
                  double var48 = 0.0D;
                  float var50 = 0.0F;
                  float var51 = 0.0F;
                  if (var44 != null) {
                     switch(var44.g()) {
                     case 0:
                        double var52 = var44.e().size() > var30 ? var44.a(var44.e().get(var30)) : 0.0D;
                        var46 = var52;
                        var52 = var44.f().size() > var30 ? var44.a(var44.f().get(var30)) : 0.0D;
                        var48 = var52;
                        break;
                     case 1:
                        var46 = var44.c();
                        var48 = var46;
                        break;
                     case 2:
                        var46 = var44.c() * var37 / 100.0D;
                        var48 = -var46;
                     }

                     var50 = (float)var46 / (float)(var12 - var14) * (float)var2.f();
                     var51 = (float)var48 / (float)(var12 - var14) * (float)var2.f();
                     if (!var9.p()) {
                        if (var37 <= 0.0D) {
                           var45.b(var45.e() + var56);
                        } else {
                           var45.b(var45.e() - var56);
                        }
                     } else if (var37 <= 0.0D) {
                        var45.b(var45.e() - var56);
                     } else {
                        var45.b(var45.e() + var56);
                     }
                  }

                  var44.a(var45, var50, var51);
               }

               if (!var9.p()) {
                  if (var37 < 0.0D) {
                     var56 = var16 + var56 - var55;
                  } else {
                     var56 = var16 - var56;
                  }
               } else if (var37 < 0.0D) {
                  var56 = var16 - var56;
               } else {
                  var56 = var16 + var56 - var55;
               }

               if (var31.k().e()) {
                  --var55;
               }

               com.aspose.cells.b.a.b.zq var58 = new com.aspose.cells.b.a.b.zq(var35, var56, var32, var55 + 1.0F);
               com.aspose.cells.b.a.b.zq var60 = new com.aspose.cells.b.a.b.zq(var58.f(), var58.g(), var58.h(), var58.i());
               if (var58.g() < (float)var2.d()) {
                  var58.d(var58.i() - ((float)var2.d() - var58.g()));
                  var58.b((float)var2.d());
               }

               if (var58.m() > (float)(var2.j() + 1)) {
                  var58.d(var58.i() - (var58.m() - (float)var2.j()));
               }

               if (var58.l() >= (float)var2.c() && var58.j() <= (float)var2.i()) {
                  if (var58.f() < (float)var2.c()) {
                     var58.c(var58.h() - ((float)var2.c() - var58.f()));
                     var58.a((float)var2.c());
                  } else if (var58.l() > (float)var2.i()) {
                     var58.c(var58.h() - (var58.l() - (float)var2.i()));
                  }

                  if (var58.h() + 1.0F >= (var32 - 1.0F) / 3.0F && var58.i() >= 0.0F) {
                     if (!var57) {
                        a(var0, var31, var58, var4.g(var1.aw()).a(var27), var16, var9);
                     }

                     Object[] var47 = new Object[5];
                     boolean var61;
                     if (var60.g() + var60.i() / 2.0F < var16) {
                        var61 = true;
                     } else if (var37 != 0.0D) {
                        var61 = false;
                     } else if (var9.p()) {
                        var61 = false;
                     } else {
                        var61 = true;
                     }

                     var47[0] = var27;
                     var47[1] = var30;
                     var47[2] = var58;
                     var47[3] = var10;
                     var47[4] = var61;
                     if (!var31.a()) {
                        com.aspose.cells.b.a.a.ze.a(var19, (Object)var47);
                     }

                     if (var1.X()) {
                        com.aspose.cells.b.a.a.ze.a(var36, (Object)var58);
                        com.aspose.cells.b.a.a.ze.a(var36, (Object)var61);
                     }
                  }
               }

               ArrayList[] var59 = new ArrayList[]{var29};
               a(var0, var1, var59, var36);
               var29 = var59[0];
            }

            return var19;
         }
      }
   }

   private static void a(zn var0, zbcp var1, ArrayList[] var2, ArrayList var3) {
      if (var2[0].size() > 0 && var3.size() > 0 && var1.X()) {
         com.aspose.cells.b.a.b.zq var4 = (com.aspose.cells.b.a.b.zq)var2[0].get(0);
         boolean var5 = (Boolean)var2[0].get(1);
         com.aspose.cells.b.a.b.zq var6 = (com.aspose.cells.b.a.b.zq)var3.get(0);
         boolean var7 = (Boolean)var3.get(1);
         com.aspose.cells.b.a.b.zo var8;
         com.aspose.cells.b.a.b.zo var9;
         if (var4.f() < var6.f()) {
            if (var5) {
               var8 = new com.aspose.cells.b.a.b.zo(var4.l(), var4.k());
            } else {
               var8 = new com.aspose.cells.b.a.b.zo(var4.l(), var4.m());
            }

            if (var7) {
               var9 = new com.aspose.cells.b.a.b.zo(var6.j(), var6.k());
            } else {
               var9 = new com.aspose.cells.b.a.b.zo(var6.j(), var6.m());
            }
         } else {
            if (var5) {
               var8 = new com.aspose.cells.b.a.b.zo(var4.j(), var4.k());
            } else {
               var8 = new com.aspose.cells.b.a.b.zo(var4.j(), var4.m());
            }

            if (var7) {
               var9 = new com.aspose.cells.b.a.b.zo(var6.l(), var6.k());
            } else {
               var9 = new com.aspose.cells.b.a.b.zo(var6.l(), var6.m());
            }
         }

         zama.a(var0, var8, var9, var1.Y());
      }

      if (var3.size() > 0) {
         var2[0] = var3;
      }

   }

   private static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2) throws Exception {
      zif var3 = var1.v();
      int var4 = var1.af();
      byte var5 = 15;
      int var6 = var3.z().getCount();
      zbcr var7 = var3.z();
      float var9 = (float)var1.K() / 100.0F;
      float var10 = (float)var1.J() / 100.0F;
      int var8;
      zbo var11;
      zbo var12;
      ArrayList var13;
      if (var4 == 1) {
         var11 = var3.e();
         var12 = var3.E();
         var8 = var7.b(1, var5);
         var13 = zhz.a((List)var3.z().c(), var1.v().S());
      } else {
         var11 = var3.g();
         var12 = var3.G();
         var8 = var7.b(2, var5);
         var13 = zhz.a((List)var3.z().d(), var1.v().S());
      }

      float var14 = 0.0F;
      if (!var12.p()) {
         var14 = (float)var2.d() + (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      } else {
         var14 = (float)var2.j() - (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      }

      double var15 = var12.D();
      double var17 = var12.z();
      ArrayList var19 = new ArrayList();
      int var20 = var13.size();
      int var21 = var11.j();
      int var22 = (int)var11.D();
      int var23 = (int)var11.z();
      boolean var24 = false;
      int var58;
      if (!var11.f() && !var3.u()) {
         var58 = zbq.a(var21, var23, var22, var1.v().S());
         if (var58 == 0) {
            var58 = 1;
         }
      } else {
         var58 = zbq.a(var21, var23, var22, var1.v().S()) + 1;
      }

      double var25 = (double)var2.e() / (double)var58;
      ArrayList var27 = new ArrayList();

      for(int var28 = 0; var28 < var20; ++var28) {
         zjd var29 = var1.D().b(var28);
         float var30 = (float)(var25 / (double)((float)var8 - var9 * (float)(var8 - 1) + var10));
         float var31 = var30 * var9;
         float var32 = var30 * var10;
         int var33 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var13.get(var28)));
         var33 = zbq.a(var21, var33, var1.v().S());
         int var34 = zbq.a(var21, var33, var22, var1.v().S());
         float var35 = (float)(var25 * (double)var34);
         if (!var11.f() && !var3.u()) {
            var35 -= (float)(var25 / 2.0D);
         }

         float var36 = 0.0F;
         if (var11.p()) {
            var36 = (float)(var2.c() + var2.e()) - var35 - var32 / 2.0F - var30 - 1.0F;
         } else {
            var36 = (float)var2.c() + var35 + var32 / 2.0F + 1.0F;
         }

         List var37 = var7.a(var4, new int[]{var5});
         int var38 = var7.a(var1, var4, new int[]{var5});
         if (var38 == -1) {
            return var19;
         }

         int var39 = var1.ai();
         if (var11.p()) {
            var36 -= (float)var38 * (var30 - var31);
         } else {
            var36 += (float)var38 * (var30 - var31);
         }

         ArrayList var40 = new ArrayList();
         if (var29 != null) {
            double var41 = var29.v();
            double var43 = var41;
            int var45;
            zjd var46;
            double var47;
            if (var41 >= 0.0D) {
               for(var45 = 0; var45 < var38; ++var45) {
                  var46 = ((zbcp)var37.get(var45)).D().b(var28);
                  if (var46 != null) {
                     var47 = var46.v();
                     if (var47 > 0.0D) {
                        var43 += var47;
                     }
                  }
               }
            } else {
               for(var45 = 0; var45 < var38; ++var45) {
                  var46 = ((zbcp)var37.get(var45)).D().b(var28);
                  if (var46 != null) {
                     var47 = var46.v();
                     if (var47 <= 0.0D) {
                        var43 += var47;
                     }
                  }
               }
            }

            float var60 = (float)(Math.abs(var41) / (var12.z() - var12.D()) * (double)var2.f());
            float var61 = (float)(Math.abs(var43) / (var12.z() - var12.D()) * (double)var2.f());
            boolean var62 = false;
            if (var60 == 0.0F) {
               var62 = true;
            }

            zsp var48 = var1.x();
            if (var48 != null && var48.d() != 2) {
               com.aspose.cells.b.a.b.zo var49 = new com.aspose.cells.b.a.b.zo(var36 + var30 / 2.0F, var14);
               double var50 = 0.0D;
               double var52 = 0.0D;
               float var54 = 0.0F;
               float var55 = 0.0F;
               if (var48 != null) {
                  switch(var48.g()) {
                  case 0:
                     double var56 = var48.e().size() > var28 ? var48.a(var48.e().get(var28)) : 0.0D;
                     var50 = var56;
                     var56 = var48.f().size() > var28 ? var48.a(var48.f().get(var28)) : 0.0D;
                     var52 = var56;
                     break;
                  case 1:
                     var50 = var48.c();
                     var52 = var50;
                     break;
                  case 2:
                     var50 = var48.c() * var41 / 100.0D;
                     var52 = -var50;
                  }

                  var54 = (float)var50 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  var55 = (float)var52 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  if (!var12.p()) {
                     if (var41 <= 0.0D) {
                        var49.b(var49.e() + var61);
                     } else {
                        var49.b(var49.e() - var61);
                     }
                  } else if (var41 <= 0.0D) {
                     var49.b(var49.e() - var61);
                  } else {
                     var49.b(var49.e() + var61);
                  }
               }

               var48.a(var49, var54, var55);
            }

            if (!var12.p()) {
               if (var41 < 0.0D) {
                  var61 = var14 + var61 - var60;
               } else {
                  var61 = var14 - var61;
               }
            } else if (var41 < 0.0D) {
               var61 = var14 - var61;
            } else {
               var61 = var14 + var61 - var60;
            }

            if (var29.k().e()) {
               --var60;
            }

            com.aspose.cells.b.a.b.zq var63 = new com.aspose.cells.b.a.b.zq(var36, var61, var30, var60 + 1.0F);
            com.aspose.cells.b.a.b.zq var64 = new com.aspose.cells.b.a.b.zq(var63.f(), var63.g(), var63.h(), var63.i());
            if (var63.g() < (float)var2.d()) {
               var63.d(var63.i() - ((float)var2.d() - var63.g()));
               var63.b((float)var2.d());
            }

            if (var63.m() > (float)(var2.j() + 1)) {
               var63.d(var63.i() - (var63.m() - (float)var2.j()));
            }

            if (var63.l() >= (float)var2.c() && var63.j() <= (float)var2.i()) {
               if (var63.f() < (float)var2.c()) {
                  var63.c(var63.h() - ((float)var2.c() - var63.f()));
                  var63.a((float)var2.c());
               } else if (var63.l() > (float)var2.i()) {
                  var63.c(var63.h() - (var63.l() - (float)var2.i()));
               }

               if (var63.h() + 1.0F >= (var30 - 1.0F) / 3.0F) {
                  if (!var62) {
                     a(var0, var29, var63, var3.g(var1.aw()).a(var39), var14, var12);
                  }

                  Object[] var51 = new Object[5];
                  boolean var65;
                  if (var64.g() + var64.i() / 2.0F < var14) {
                     var65 = true;
                  } else if (var41 != 0.0D) {
                     var65 = false;
                  } else if (var12.p()) {
                     var65 = false;
                  } else {
                     var65 = true;
                  }

                  var51[0] = var39;
                  var51[1] = var28;
                  var51[2] = var64;
                  var51[3] = var11;
                  var51[4] = var65;
                  if (!var29.a()) {
                     com.aspose.cells.b.a.a.ze.a(var19, (Object)var51);
                  }

                  if (var1.X()) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var63);
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var65);
                  }
               }
            }
         }

         ArrayList[] var59 = new ArrayList[]{var27};
         a(var0, var1, var59, var40);
         var27 = var59[0];
      }

      return var19;
   }

   static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3, int var4) throws Exception {
      ArrayList var5 = new ArrayList();
      zif var6 = var1.v();
      int[] var7 = new int[]{38, 41};
      int var8 = var1.af();
      zbo var9;
      zbo var10;
      if (var8 == 1) {
         var10 = var6.e();
         var9 = var6.E();
      } else {
         var10 = var6.g();
         var9 = var6.G();
      }

      if (var10.k() == 2) {
         return a(var0, var1, var2, var3);
      } else {
         float var11 = 0.0F;
         if (!var9.p()) {
            var11 = (float)var2.d() + (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var2.f();
         } else {
            var11 = (float)var2.j() - (float)var9.z() / (float)(var9.z() - var9.D()) * (float)var2.f();
         }

         zbcr var12 = var6.z();
         int var13 = var12.getCount();
         float var14 = (float)var1.J() / 100.0F;
         double var15 = var9.D();
         double var17 = var9.z();
         boolean var19 = var1.L();
         zalv var20 = var1.O();
         zalv var21 = var1.P();
         ziw var22 = var1.S();
         ziw var23 = var1.T();
         boolean var24 = false;
         int var25 = var4;
         if (var10.p) {
            var25 = (int)var10.z();
         }

         int var57;
         if (!var10.f() && !var6.u()) {
            var57 = var25 - 1;
            if (var57 == 0) {
               var57 = 1;
            }
         } else {
            var57 = var25;
         }

         double var26 = (double)var2.e() / (double)var57;
         ArrayList var28 = new ArrayList();
         ArrayList var29 = new ArrayList();
         List var30 = var12.a(var8, var7);

         int var31;
         for(var31 = 0; var31 < var30.size(); ++var31) {
            zbcp var32 = (zbcp)var30.get(var31);
            if ((!var6.an() || var32.equals(var1)) && (var1.N() || var1.M() || var32.equals(var1))) {
               int var33 = var12.a(var32, var8, var7);
               int var34 = var32.ai();
               com.aspose.cells.b.a.b.zm var35 = null;
               ArrayList var36 = new ArrayList();
               zjf var37 = var32.D();

               for(int var38 = 0; var38 < var4; ++var38) {
                  zjd var39 = var37.b(var38);
                  if (var39 != null) {
                     if (var35 != null) {
                        var35.a();
                     }

                     var35 = zama.a(var39.k());
                     double var40 = (double)((float)var26 * (float)var38 + 1.0F);
                     if (var10.f() || var6.u()) {
                        var40 += (double)((float)(var26 / 2.0D));
                     }

                     if (var10.p()) {
                        var40 = (double)(var2.c() + var2.e()) - var40;
                     } else {
                        var40 += (double)var2.c();
                     }

                     double var42 = var39.v();
                     double var44 = var42;
                     int var46;
                     zjd var47;
                     double var48;
                     if (var42 >= 0.0D) {
                        for(var46 = 0; var46 < var33; ++var46) {
                           var47 = ((zbcp)var30.get(var46)).D().b(var38);
                           if (var47 != null) {
                              var48 = var47.v();
                              if (var48 > 0.0D) {
                                 var44 += var48;
                              }
                           }
                        }
                     } else {
                        for(var46 = 0; var46 < var33; ++var46) {
                           var47 = ((zbcp)var30.get(var46)).D().b(var38);
                           if (var47 != null) {
                              var48 = var47.v();
                              if (var48 <= 0.0D) {
                                 var44 += var48;
                              }
                           }
                        }
                     }

                     float var73 = (float)(Math.abs(var44) / (var9.z() - var9.D()) * (double)var2.f());
                     zsp var74 = var1.x();
                     com.aspose.cells.b.a.b.zo var75;
                     if (var74 != null && var74.d() != 2) {
                        var75 = new com.aspose.cells.b.a.b.zo((float)var40, var11);
                        double var49 = 0.0D;
                        double var51 = 0.0D;
                        float var53 = 0.0F;
                        float var54 = 0.0F;
                        if (var74 != null && !var39.a()) {
                           switch(var74.g()) {
                           case 0:
                              double var55 = var74.e().size() > var38 ? var74.a(var74.e().get(var38)) : 0.0D;
                              var49 = var55;
                              var55 = var74.f().size() > var38 ? var74.a(var74.f().get(var38)) : 0.0D;
                              var51 = var55;
                              break;
                           case 1:
                              var49 = var74.c();
                              var51 = var49;
                              break;
                           case 2:
                              var49 = var74.c() * var42 / 100.0D;
                              var51 = -var49;
                           }

                           var53 = (float)var49 / (float)(var9.z() - var9.D()) * (float)var2.f();
                           var54 = (float)var51 / (float)(var9.z() - var9.D()) * (float)var2.f();
                           if (!var9.p()) {
                              if (var42 < 0.0D) {
                                 var75.b(var75.e() + var73);
                              } else {
                                 var75.b(var75.e() - var73);
                              }
                           } else if (var42 < 0.0D) {
                              var75.b(var75.e() - var73);
                           } else {
                              var75.b(var75.e() + var73);
                           }
                        }

                        if (var32.equals(var1) && !var39.a()) {
                           var74.a(var75, var53, var54);
                        }
                     }

                     if (!var9.p()) {
                        if (var42 < 0.0D) {
                           var73 += var11;
                        } else {
                           var73 = var11 - var73;
                        }
                     } else if (var42 < 0.0D) {
                        var73 = var11 - var73;
                     } else {
                        var73 += var11;
                     }

                     var75 = new com.aspose.cells.b.a.b.zo((float)var40, var73);
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)var75);
                     if (var32.equals(var1)) {
                        if (var19) {
                           zama.a(var0, (float)var40, var73, (float)var40, var3, var20);
                        }

                        com.aspose.cells.b.a.a.ze.a(var29, (Object)var75);
                        if (!var39.a()) {
                           Object[] var76 = new Object[]{var34, var38, var75, var10};
                           com.aspose.cells.b.a.a.ze.a(var5, (Object)var76);
                        }
                     }
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)null);
                     if (var32.equals(var1)) {
                        com.aspose.cells.b.a.a.ze.a(var29, (Object)null);
                     }
                  }
               }

               if (var32.equals(var1)) {
                  if (var35 == null) {
                     var35 = zama.a(var32.z());
                  }

                  a((zn)var0, (zbcp)var32, (List)var36, (com.aspose.cells.b.a.b.zm)var35, (com.aspose.cells.b.a.b.zp)var2);
               }

               if (var35 != null) {
                  var35.a();
               }

               com.aspose.cells.b.a.a.ze.a(var28, (Object)var36);
            }
         }

         for(var31 = 0; var31 < var4; ++var31) {
            boolean var58 = false;
            boolean var59 = false;
            float var60 = 0.0F;
            float var62 = 0.0F;
            float var61 = 0.0F;
            boolean var63 = false;
            boolean var64 = false;
            float var65 = 0.0F;
            float var68 = 0.0F;

            int var41;
            for(var41 = 0; var41 < var28.size(); ++var41) {
               ArrayList var67 = (ArrayList)var28.get(var41);
               if (var67.size() > var31 && var67.get(var31) != null) {
                  com.aspose.cells.b.a.b.zo var43 = (com.aspose.cells.b.a.b.zo)var67.get(var31);
                  var61 = var43.d();
                  if (!var58) {
                     var60 = var43.e();
                     var58 = true;
                  } else if (!var59) {
                     if (var60 < var43.e()) {
                        var62 = var60;
                        var60 = var43.e();
                        var59 = true;
                     } else {
                        var62 = var43.e();
                        var59 = true;
                     }
                  } else {
                     if (var60 < var43.e()) {
                        var60 = var43.e();
                     }

                     if (var62 > var43.e()) {
                        var62 = var43.e();
                     }
                  }

                  if (var41 == 0) {
                     var65 = var43.e();
                     var63 = true;
                  } else if (var41 == var13 - 1) {
                     var68 = var43.e();
                     var64 = true;
                  }
               }
            }

            if (var1.M() && var58 && var59) {
               float[] var66 = new float[]{var61};
               float[] var69 = new float[]{var60};
               var66[0] = var61;
               float[] var71 = new float[]{var62};
               boolean var72 = a(var9.X(), var2, var66, var69, var66, var71);
               var61 = var66[0];
               var60 = var69[0];
               var61 = var66[0];
               var62 = var71[0];
               if (var72) {
                  zama.a(var0, var61, var60, var61, var62, var21);
               }
            }

            if (var1.N() && var63 && var64) {
               var41 = (int)(var26 / (double)(1.0F + var14));
               com.aspose.cells.b.a.b.zq var70 = new com.aspose.cells.b.a.b.zq();
               if (var65 <= var68) {
                  var70.c((float)var41);
                  var70.d(var68 - var65);
                  var70.a(var61 - var70.h() / 2.0F);
                  var70.b(var65);
                  a(var0, var23, var70);
               } else {
                  var70.c((float)var41);
                  var70.d(var65 - var68);
                  var70.a(var61 - var70.h() / 2.0F);
                  var70.b(var68);
                  a(var0, var22, var70);
               }
            }
         }

         a(var0, var1, (List)var29, (com.aspose.cells.b.a.b.zp)var2);
         return var5;
      }
   }

   private static ArrayList a(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3) throws Exception {
      ArrayList var4 = new ArrayList();
      zif var5 = var1.v();
      int[] var6 = new int[]{38, 41};
      int var7 = var1.af();
      zbcr var8 = var5.z();
      int var9 = var8.getCount();
      float var10 = (float)var1.J() / 100.0F;
      zbo var11;
      zbo var12;
      ArrayList var13;
      if (var7 == 1) {
         var12 = var5.e();
         var11 = var5.E();
         var13 = zhz.a((List)var5.z().c(), var1.v().S());
      } else {
         var12 = var5.g();
         var11 = var5.G();
         var13 = zhz.a((List)var5.z().d(), var1.v().S());
      }

      float var14 = 0.0F;
      if (!var11.p()) {
         var14 = (float)var2.d() + (float)var11.z() / (float)(var11.z() - var11.D()) * (float)var2.f();
      } else {
         var14 = (float)var2.j() - (float)var11.z() / (float)(var11.z() - var11.D()) * (float)var2.f();
      }

      double var15 = var11.D();
      double var17 = var11.z();
      boolean var19 = var1.L();
      zalv var20 = var1.O();
      zalv var21 = var1.P();
      ziw var22 = var1.S();
      ziw var23 = var1.T();
      int var24 = var13.size();
      int var25 = var12.j();
      int var26 = (int)var12.D();
      int var27 = (int)var12.z();
      boolean var28 = false;
      int var62;
      if (!var12.f() && !var5.u()) {
         var62 = zbq.a(var25, var27, var26, var1.v().S());
         if (var62 == 0) {
            var62 = 1;
         }
      } else {
         var62 = zbq.a(var25, var27, var26, var1.v().S()) + 1;
      }

      double var29 = (double)var2.e() / (double)var62;
      float var31 = 0.0F;
      ArrayList var32 = new ArrayList();
      ArrayList var33 = new ArrayList();
      List var34 = var8.a(var7, var6);

      int var35;
      for(var35 = 0; var35 < var34.size(); ++var35) {
         zbcp var36 = (zbcp)var34.get(var35);
         if ((!var5.an() || var36.equals(var1)) && (var1.N() || var1.M() || var36.equals(var1))) {
            int var37 = var8.a(var36, var7, var6);
            int var38 = var36.ai();
            com.aspose.cells.b.a.b.zm var39 = null;
            ArrayList var40 = new ArrayList();

            for(int var41 = 0; var41 < var24; ++var41) {
               zjd var42 = var36.D().b(var41);
               if (var42 != null) {
                  if (var39 != null) {
                     var39.a();
                  }

                  var39 = zama.a(var42.k());
                  int var43 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var13.get(var41)));
                  var43 = zbq.a(var25, var43, var1.v().S());
                  int var44 = zbq.a(var25, var43, var26, var1.v().S());
                  float var45 = (float)(var29 * (double)var44);
                  var31 = (float)(var29 * (double)zbq.a(var25, zbq.a(var12.j(), var12.y(), (int)var12.x(), var43, var1.v().S()), var43, var1.v().S()));
                  if (var12.f() || var5.u()) {
                     var45 += (float)(var29 / 2.0D);
                  }

                  float var46 = 0.0F;
                  if (var12.p()) {
                     var46 = (float)(var2.c() + var2.e()) - var45;
                  } else {
                     var46 = (float)var2.c() + var45;
                  }

                  double var47 = var42.v();
                  double var49 = var47;
                  int var51;
                  zjd var52;
                  double var53;
                  if (var47 >= 0.0D) {
                     for(var51 = 0; var51 < var37; ++var51) {
                        var52 = ((zbcp)var34.get(var51)).D().b(var41);
                        if (var52 != null) {
                           var53 = var52.v();
                           if (var53 > 0.0D) {
                              var49 += var53;
                           }
                        }
                     }
                  } else {
                     for(var51 = 0; var51 < var37; ++var51) {
                        var52 = ((zbcp)var34.get(var51)).D().b(var41);
                        if (var52 != null) {
                           var53 = var52.v();
                           if (var53 <= 0.0D) {
                              var49 += var53;
                           }
                        }
                     }
                  }

                  float var79 = (float)(Math.abs(var49) / (var11.z() - var11.D()) * (double)var2.f());
                  zsp var80 = var1.x();
                  com.aspose.cells.b.a.b.zo var81;
                  if (var80 != null && var80.d() != 2) {
                     var81 = new com.aspose.cells.b.a.b.zo(var46, var14);
                     double var54 = 0.0D;
                     double var56 = 0.0D;
                     float var58 = 0.0F;
                     float var59 = 0.0F;
                     if (var80 != null && !var42.a()) {
                        switch(var80.g()) {
                        case 0:
                           double var60 = var80.e().size() > var41 ? var80.a(var80.e().get(var41)) : 0.0D;
                           var54 = var60;
                           var60 = var80.f().size() > var41 ? var80.a(var80.f().get(var41)) : 0.0D;
                           var56 = var60;
                           break;
                        case 1:
                           var54 = var80.c();
                           var56 = var54;
                           break;
                        case 2:
                           var54 = var80.c() * var47 / 100.0D;
                           var56 = -var54;
                        }

                        var58 = (float)var54 / (float)(var11.z() - var11.D()) * (float)var2.f();
                        var59 = (float)var56 / (float)(var11.z() - var11.D()) * (float)var2.f();
                        if (!var11.p()) {
                           if (var47 < 0.0D) {
                              var81.b(var81.e() + var79);
                           } else {
                              var81.b(var81.e() - var79);
                           }
                        } else if (var47 < 0.0D) {
                           var81.b(var81.e() - var79);
                        } else {
                           var81.b(var81.e() + var79);
                        }
                     }

                     if (var36.equals(var1) && !var42.a()) {
                        var80.a(var81, var58, var59);
                     }
                  }

                  if (!var11.p()) {
                     if (var47 < 0.0D) {
                        var79 += var14;
                     } else {
                        var79 = var14 - var79;
                     }
                  } else if (var47 < 0.0D) {
                     var79 = var14 - var79;
                  } else {
                     var79 += var14;
                  }

                  var81 = new com.aspose.cells.b.a.b.zo(var46, var79);
                  if (var40.size() == 0) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var81);
                  } else {
                     a(var81, var40, var12.p());
                  }

                  if (var36.equals(var1)) {
                     if (var19) {
                        zama.a(var0, var46, var79, var46, var3, var20);
                     }

                     com.aspose.cells.b.a.a.ze.a(var33, (Object)var81);
                     if (!var42.a()) {
                        Object[] var82 = new Object[]{var38, var41, var81, var12};
                        com.aspose.cells.b.a.a.ze.a(var4, (Object)var82);
                     }
                  }
               } else {
                  if (var12.p()) {
                     var40.add(0, (Object)null);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)null);
                  }

                  if (var36.equals(var1)) {
                     com.aspose.cells.b.a.a.ze.a(var33, (Object)null);
                  }
               }
            }

            if (var36.equals(var1)) {
               if (var39 == null) {
                  var39 = zama.a(var36.z());
               }

               a((zn)var0, (zbcp)var36, (List)var40, (com.aspose.cells.b.a.b.zm)var39, (com.aspose.cells.b.a.b.zp)var2);
            }

            if (var39 != null) {
               var39.a();
            }

            com.aspose.cells.b.a.a.ze.a(var32, (Object)var40);
         }
      }

      for(var35 = 0; var35 < var24; ++var35) {
         boolean var63 = false;
         boolean var64 = false;
         float var65 = 0.0F;
         float var67 = 0.0F;
         float var66 = 0.0F;
         boolean var68 = false;
         boolean var69 = false;
         float var70 = 0.0F;
         float var71 = 0.0F;

         int var72;
         for(var72 = 0; var72 < var32.size(); ++var72) {
            ArrayList var75 = (ArrayList)var32.get(var72);
            if (var75.size() > var35 && var75.get(var35) != null) {
               com.aspose.cells.b.a.b.zo var74 = (com.aspose.cells.b.a.b.zo)var75.get(var35);
               var66 = var74.d();
               if (!var63) {
                  var65 = var74.e();
                  var63 = true;
               } else if (!var64) {
                  if (var65 < var74.e()) {
                     var67 = var65;
                     var65 = var74.e();
                     var64 = true;
                  } else {
                     var67 = var74.e();
                     var64 = true;
                  }
               } else {
                  if (var65 < var74.e()) {
                     var65 = var74.e();
                  }

                  if (var67 > var74.e()) {
                     var67 = var74.e();
                  }
               }

               if (var72 == 0) {
                  var70 = var74.e();
                  var68 = true;
               } else if (var72 == var9 - 1) {
                  var71 = var74.e();
                  var69 = true;
               }
            }
         }

         if (var1.M() && var63 && var64) {
            float[] var73 = new float[]{var66};
            float[] var77 = new float[]{var65};
            var73[0] = var66;
            float[] var76 = new float[]{var67};
            boolean var48 = a(var11.X(), var2, var73, var77, var73, var76);
            var66 = var73[0];
            var65 = var77[0];
            var66 = var73[0];
            var67 = var76[0];
            if (var48) {
               zama.a(var0, var66, var65, var66, var67, var21);
            }
         }

         if (var1.N() && var68 && var69) {
            var72 = (int)(var31 / (1.0F + var10));
            com.aspose.cells.b.a.b.zq var78 = new com.aspose.cells.b.a.b.zq();
            if (var70 <= var71) {
               var78.c((float)var72);
               var78.d(var71 - var70);
               var78.a(var66 - var78.h() / 2.0F);
               var78.b(var70);
               a(var0, var23, var78);
            } else {
               var78.c((float)var72);
               var78.d(var70 - var71);
               var78.a(var66 - var78.h() / 2.0F);
               var78.b(var71);
               a(var0, var22, var78);
            }
         }
      }

      a(var0, var1, (List)var33, (com.aspose.cells.b.a.b.zp)var2);
      return var4;
   }

   static ArrayList b(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, int var3) throws Exception {
      zif var4 = var1.v();
      int var5 = var1.af();
      byte var6 = 16;
      zbcr var7 = var4.z();
      int var8 = var7.getCount();
      int var9;
      zbo var10;
      zbo var11;
      if (var5 == 1) {
         var11 = var4.e();
         var10 = var4.E();
         var9 = var7.b(1, var6);
      } else {
         var11 = var4.g();
         var10 = var4.G();
         var9 = var7.b(2, var6);
      }

      if (var11.k() == 2) {
         return b(var0, var1, var2);
      } else {
         float var12 = 0.0F;
         if (!var10.p()) {
            var12 = (float)var2.d() + (float)var10.z() / (float)(var10.z() - var10.D()) * (float)var2.f();
         } else {
            var12 = (float)var2.j() - (float)var10.z() / (float)(var10.z() - var10.D()) * (float)var2.f();
         }

         float var13 = (float)var1.K() / 100.0F;
         float var14 = (float)var1.J() / 100.0F;
         ArrayList var15 = new ArrayList();
         boolean var16 = false;
         int var17 = var3;
         if (var11.p) {
            var17 = (int)var11.z();
         }

         int var52;
         if (!var11.f() && !var4.u()) {
            var52 = var17 - 1;
            if (var52 == 0) {
               var52 = 1;
            }
         } else {
            var52 = var17;
         }

         double var18 = (double)var2.e() / (double)var52;
         float var20 = 0.0F;
         List var21 = var7.a(var5, new int[]{var6});
         int var22 = var7.a(var1, var5, new int[]{var6});
         if (var22 == -1) {
            return var15;
         } else {
            int var23 = var1.ai();
            zjf var24 = var1.D();
            ArrayList var25 = new ArrayList();

            for(int var26 = 0; var26 < var24.getCount(); ++var26) {
               zjd var27 = var24.b(var26);
               float var28 = (float)var18 / ((float)var9 - var13 * (float)(var9 - 1) + var14);
               float var29 = var28 * var13;
               float var30 = var28 * var14;
               var20 = (float)var22 * (var28 - var29);
               float var31 = (float)var18 * (float)var26 + var30 / 2.0F + var20;
               if (!var11.f() && !var4.u()) {
                  var31 -= (float)(var18 / 2.0D);
               }

               if (var11.p()) {
                  var31 = (float)(var2.c() + var2.e()) - var31 - var28;
               } else {
                  var31 += (float)var2.c();
               }

               ArrayList var32 = new ArrayList();
               double var33 = var27.v();
               double var35 = var33;
               double var37 = 0.0D;
               int var39;
               zjd var40;
               double var41;
               if (var33 >= 0.0D) {
                  for(var39 = 0; var39 < var22; ++var39) {
                     var40 = ((zbcp)var21.get(var39)).D().b(var26);
                     if (var40 != null) {
                        var41 = var40.v();
                        if (var41 > 0.0D) {
                           var35 += var41;
                        }
                     }
                  }
               } else {
                  for(var39 = 0; var39 < var22; ++var39) {
                     var40 = ((zbcp)var21.get(var39)).D().b(var26);
                     if (var40 != null) {
                        var41 = var40.v();
                        if (var41 <= 0.0D) {
                           var35 += var41;
                        }
                     }
                  }
               }

               for(var39 = 0; var39 < var21.size(); ++var39) {
                  var40 = ((zbcp)var21.get(var39)).D().b(var26);
                  if (var40 != null) {
                     var41 = var40.v();
                     var37 += Math.abs(var41);
                  }
               }

               if (var37 != 0.0D && var37 != 0.0D) {
                  float var53 = (float)(Math.abs(var33) * 100.0D / var37 / (var10.z() - var10.D()) * (double)var2.f());
                  float var54 = (float)(Math.abs(var35) * 100.0D / var37 / (var10.z() - var10.D()) * (double)var2.f());
                  boolean var55 = false;
                  if (var53 == 0.0F) {
                     var55 = true;
                  }

                  zsp var42 = var1.x();
                  if (var42 != null && var42.d() != 2) {
                     com.aspose.cells.b.a.b.zo var43 = new com.aspose.cells.b.a.b.zo(var31 + var28 / 2.0F, var12);
                     double var44 = 0.0D;
                     double var46 = 0.0D;
                     float var48 = 0.0F;
                     float var49 = 0.0F;
                     if (var42 != null) {
                        switch(var42.g()) {
                        case 0:
                           double var50 = var42.e().size() > var26 ? var42.a(var42.e().get(var26)) : 0.0D;
                           var44 = var50;
                           var50 = var42.f().size() > var26 ? var42.a(var42.f().get(var26)) : 0.0D;
                           var46 = var50;
                           break;
                        case 1:
                           var44 = var42.c();
                           var46 = var44;
                           break;
                        case 2:
                           var44 = var42.c() * var33 / 100.0D;
                           var46 = -var44;
                        }

                        var46 = var46 * 100.0D / var37;
                        var44 = var44 * 100.0D / var37;
                        var48 = (float)var44 / (float)(var10.z() - var10.D()) * (float)var2.f();
                        var49 = (float)var46 / (float)(var10.z() - var10.D()) * (float)var2.f();
                        if (!var10.p()) {
                           if (var33 <= 0.0D) {
                              var43.b(var43.e() + var54);
                           } else {
                              var43.b(var43.e() - var54);
                           }
                        } else if (var33 <= 0.0D) {
                           var43.b(var43.e() - var54);
                        } else {
                           var43.b(var43.e() + var54);
                        }
                     }

                     var42.a(var43, var48, var49);
                  }

                  if (!var10.p()) {
                     if (var33 < 0.0D) {
                        var54 = var12 + var54 - var53;
                     } else {
                        var54 = var12 - var54;
                     }
                  } else if (var33 < 0.0D) {
                     var54 = var12 - var54;
                  } else {
                     var54 = var12 + var54 - var53;
                  }

                  if (var27.k().e()) {
                     --var53;
                  }

                  com.aspose.cells.b.a.b.zq var56 = new com.aspose.cells.b.a.b.zq(var31, var54, var28, var53 + 1.0F);
                  com.aspose.cells.b.a.b.zq var58 = new com.aspose.cells.b.a.b.zq(var56.f(), var56.g(), var56.h(), var56.i());
                  if (var56.g() < (float)var2.d()) {
                     var56.d(var56.i() - ((float)var2.d() - var56.g()));
                     var56.b((float)var2.d());
                  }

                  if (var56.m() > (float)(var2.j() + 1)) {
                     var56.d(var56.i() - (var56.m() - (float)var2.j()));
                  }

                  if (var56.l() >= (float)var2.c() && var56.j() <= (float)var2.i()) {
                     if (var56.f() < (float)var2.c()) {
                        var56.c(var56.h() - ((float)var2.c() - var56.f()));
                        var56.a((float)var2.c());
                     } else if (var56.l() > (float)var2.i()) {
                        var56.c(var56.h() - (var56.l() - (float)var2.i()));
                     }

                     if (var56.h() + 1.0F >= (var28 - 1.0F) / 3.0F && var56.i() >= 0.0F) {
                        if (!var55) {
                           a(var0, var27, var56, var4.g(var1.aw()).a(var23), var12, var10);
                        }

                        Object[] var45 = new Object[5];
                        boolean var59;
                        if (var58.g() + var58.i() / 2.0F < var12) {
                           var59 = true;
                        } else if (var33 != 0.0D) {
                           var59 = false;
                        } else if (var10.p()) {
                           var59 = false;
                        } else {
                           var59 = true;
                        }

                        var45[0] = var23;
                        var45[1] = var26;
                        var45[2] = var58;
                        var45[3] = var11;
                        var45[4] = var59;
                        if (!var27.a()) {
                           com.aspose.cells.b.a.a.ze.a(var15, (Object)var45);
                        }

                        if (var1.X()) {
                           com.aspose.cells.b.a.a.ze.a(var32, (Object)var56);
                           com.aspose.cells.b.a.a.ze.a(var32, (Object)var59);
                        }
                     }
                  }

                  ArrayList[] var57 = new ArrayList[]{var25};
                  a(var0, var1, var57, var32);
                  var25 = var57[0];
               }
            }

            return var15;
         }
      }
   }

   private static ArrayList b(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2) throws Exception {
      zif var3 = var1.v();
      int var4 = var1.af();
      byte var5 = 16;
      int var6 = var3.z().getCount();
      zbcr var7 = var3.z();
      float var9 = (float)var1.K() / 100.0F;
      float var10 = (float)var1.J() / 100.0F;
      int var8;
      zbo var11;
      zbo var12;
      ArrayList var13;
      if (var4 == 1) {
         var11 = var3.e();
         var12 = var3.E();
         var8 = var7.b(1, var5);
         var13 = zhz.a((List)var3.z().c(), var1.v().S());
      } else {
         var11 = var3.g();
         var12 = var3.G();
         var8 = var7.b(2, var5);
         var13 = zhz.a((List)var3.z().d(), var1.v().S());
      }

      float var14 = 0.0F;
      if (!var12.p()) {
         var14 = (float)var2.d() + (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      } else {
         var14 = (float)var2.j() - (float)var12.z() / (float)(var12.z() - var12.D()) * (float)var2.f();
      }

      double var15 = var12.D();
      double var17 = var12.z();
      ArrayList var19 = new ArrayList();
      int var20 = var13.size();
      int var21 = var11.j();
      int var22 = (int)var11.D();
      int var23 = (int)var11.z();
      boolean var24 = false;
      int var60;
      if (!var11.f() && !var3.u()) {
         var60 = zbq.a(var21, var23, var22, var1.v().S());
         if (var60 == 0) {
            var60 = 1;
         }
      } else {
         var60 = zbq.a(var21, var23, var22, var1.v().S()) + 1;
      }

      double var25 = (double)var2.e() / (double)var60;
      ArrayList var27 = new ArrayList();

      for(int var28 = 0; var28 < var20; ++var28) {
         zjd var29 = var1.D().b(var28);
         float var30 = (float)(var25 / (double)((float)var8 - var9 * (float)(var8 - 1) + var10));
         float var31 = var30 * var9;
         float var32 = var30 * var10;
         int var33 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var13.get(var28)));
         var33 = zbq.a(var21, var33, var1.v().S());
         int var34 = zbq.a(var21, var33, var22, var1.v().S());
         float var35 = (float)(var25 * (double)var34);
         if (!var11.f() && !var3.u()) {
            var35 -= (float)(var25 / 2.0D);
         }

         float var36 = 0.0F;
         if (var11.p()) {
            var36 = (float)(var2.c() + var2.e()) - var35 - var32 / 2.0F - var30 - 1.0F;
         } else {
            var36 = (float)var2.c() + var35 + var32 / 2.0F + 1.0F;
         }

         List var37 = var7.a(var4, new int[]{var5});
         int var38 = var7.a(var1, var4, new int[]{var5});
         if (var38 == -1) {
            return new ArrayList();
         }

         int var39 = var1.ai();
         if (var11.p()) {
            var36 -= (float)var38 * (var30 - var31);
         } else {
            var36 += (float)var38 * (var30 - var31);
         }

         ArrayList var40 = new ArrayList();
         if (var29 != null) {
            double var41 = var29.v();
            double var43 = var41;
            double var45 = 0.0D;
            int var47;
            zjd var48;
            double var49;
            if (var41 >= 0.0D) {
               for(var47 = 0; var47 < var38; ++var47) {
                  var48 = ((zbcp)var37.get(var47)).D().b(var28);
                  if (var48 != null) {
                     var49 = var48.v();
                     if (var49 > 0.0D) {
                        var43 += var49;
                     }
                  }
               }
            } else {
               for(var47 = 0; var47 < var38; ++var47) {
                  var48 = ((zbcp)var37.get(var47)).D().b(var28);
                  if (var48 != null) {
                     var49 = var48.v();
                     if (var49 <= 0.0D) {
                        var43 += var49;
                     }
                  }
               }
            }

            for(var47 = 0; var47 < var37.size(); ++var47) {
               var48 = ((zbcp)var37.get(var47)).D().b(var28);
               if (var48 != null) {
                  var49 = var48.v();
                  var45 += Math.abs(var49);
               }
            }

            if (var45 == 0.0D || var45 == 0.0D) {
               continue;
            }

            float var62 = (float)(Math.abs(var41) * 100.0D / var45 / (var12.z() - var12.D()) * (double)var2.f());
            float var63 = (float)(Math.abs(var43) * 100.0D / var45 / (var12.z() - var12.D()) * (double)var2.f());
            boolean var64 = false;
            if (var62 == 0.0F) {
               var64 = true;
            }

            zsp var50 = var1.x();
            if (var50 != null && var50.d() != 2 && !var29.a()) {
               com.aspose.cells.b.a.b.zo var51 = new com.aspose.cells.b.a.b.zo(var36 + var30 / 2.0F, var14);
               double var52 = 0.0D;
               double var54 = 0.0D;
               float var56 = 0.0F;
               float var57 = 0.0F;
               if (var50 != null) {
                  switch(var50.g()) {
                  case 0:
                     double var58 = var50.e().size() > var28 ? var50.a(var50.e().get(var28)) : 0.0D;
                     var52 = var58;
                     var58 = var50.f().size() > var28 ? var50.a(var50.f().get(var28)) : 0.0D;
                     var54 = var58;
                     break;
                  case 1:
                     var52 = var50.c();
                     var54 = var52;
                     break;
                  case 2:
                     var52 = var50.c() * var41 / 100.0D;
                     var54 = -var52;
                  }

                  var54 = var54 * 100.0D / var45;
                  var52 = var52 * 100.0D / var45;
                  var56 = (float)var52 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  var57 = (float)var54 / (float)(var12.z() - var12.D()) * (float)var2.f();
                  if (!var12.p()) {
                     if (var41 <= 0.0D) {
                        var51.b(var51.e() + var63);
                     } else {
                        var51.b(var51.e() - var63);
                     }
                  } else if (var41 <= 0.0D) {
                     var51.b(var51.e() - var63);
                  } else {
                     var51.b(var51.e() + var63);
                  }
               }

               var50.a(var51, var56, var57);
            }

            if (!var12.p()) {
               if (var41 < 0.0D) {
                  var63 = var14 + var63 - var62;
               } else {
                  var63 = var14 - var63;
               }
            } else if (var41 < 0.0D) {
               var63 = var14 - var63;
            } else {
               var63 = var14 + var63 - var62;
            }

            if (var29.k().e()) {
               --var62;
            }

            com.aspose.cells.b.a.b.zq var65 = new com.aspose.cells.b.a.b.zq(var36, var63, var30, var62 + 1.0F);
            com.aspose.cells.b.a.b.zq var66 = new com.aspose.cells.b.a.b.zq(var65.f(), var65.g(), var65.h(), var65.i());
            if (var65.g() < (float)var2.d()) {
               var65.d(var65.i() - ((float)var2.d() - var65.g()));
               var65.b((float)var2.d());
            }

            if (var65.m() > (float)(var2.j() + 1)) {
               var65.d(var65.i() - (var65.m() - (float)var2.j()));
            }

            if (var65.l() >= (float)var2.c() && var65.j() <= (float)var2.i()) {
               if (var65.f() < (float)var2.c()) {
                  var65.c(var65.h() - ((float)var2.c() - var65.f()));
                  var65.a((float)var2.c());
               } else if (var65.l() > (float)var2.i()) {
                  var65.c(var65.h() - (var65.l() - (float)var2.i()));
               }

               if (var65.h() + 1.0F >= (var30 - 1.0F) / 3.0F) {
                  if (!var64 && !var29.a()) {
                     a(var0, var29, var65, var3.g(var1.aw()).a(var39), var14, var12);
                  }

                  Object[] var53 = new Object[5];
                  boolean var67;
                  if (var66.g() + var66.i() / 2.0F < var14) {
                     var67 = true;
                  } else if (var41 != 0.0D) {
                     var67 = false;
                  } else if (var12.p()) {
                     var67 = false;
                  } else {
                     var67 = true;
                  }

                  var53[0] = var39;
                  var53[1] = var28;
                  var53[2] = var66;
                  var53[3] = var11;
                  var53[4] = var67;
                  if (!var29.a()) {
                     com.aspose.cells.b.a.a.ze.a(var19, (Object)var53);
                  }

                  if (var1.X()) {
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var65);
                     com.aspose.cells.b.a.a.ze.a(var40, (Object)var67);
                  }
               }
            }
         }

         ArrayList[] var61 = new ArrayList[]{var27};
         a(var0, var1, var61, var40);
         var27 = var61[0];
      }

      return var19;
   }

   static ArrayList b(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3, int var4) throws Exception {
      zif var5 = var1.v();
      int[] var6 = new int[]{39, 42};
      int var7 = var1.af();
      zbo var8;
      zbo var9;
      if (var7 == 1) {
         var9 = var5.e();
         var8 = var5.E();
      } else {
         var9 = var5.g();
         var8 = var5.G();
      }

      if (var9.k() == 2) {
         return b(var0, var1, var2, var3);
      } else {
         float var10 = 0.0F;
         if (!var8.p()) {
            var10 = (float)var2.d() + (float)var8.z() / (float)(var8.z() - var8.D()) * (float)var2.f();
         } else {
            var10 = (float)var2.j() - (float)var8.z() / (float)(var8.z() - var8.D()) * (float)var2.f();
         }

         zbcr var11 = var5.z();
         int var12 = var11.getCount();
         float var13 = (float)var1.J() / 100.0F;
         double var14 = var8.D();
         double var16 = var8.z();
         boolean var18 = var1.L();
         zalv var19 = var1.O();
         zalv var20 = var1.P();
         ziw var21 = var1.S();
         ziw var22 = var1.T();
         ArrayList var23 = new ArrayList();
         boolean var24 = false;
         int var25 = var4;
         if (var9.p) {
            var25 = (int)var9.z();
         }

         int var59;
         if (!var9.f() && !var5.u()) {
            var59 = var25 - 1;
            if (var59 == 0) {
               var59 = 1;
            }
         } else {
            var59 = var25;
         }

         double var26 = (double)var2.e() / (double)var59;
         ArrayList var28 = new ArrayList();
         ArrayList var29 = new ArrayList();
         List var30 = var11.a(var7, var6);

         int var31;
         for(var31 = 0; var31 < var30.size(); ++var31) {
            zbcp var32 = (zbcp)var30.get(var31);
            if ((!var5.an() || var32.equals(var1)) && (var1.N() || var1.M() || var32.equals(var1))) {
               int var33 = var11.a(var32, var7, var6);
               int var34 = var32.ai();
               com.aspose.cells.b.a.b.zm var35 = null;
               ArrayList var36 = new ArrayList();
               zjf var37 = var32.D();

               for(int var38 = 0; var38 < var4; ++var38) {
                  zjd var39 = var37.b(var38);
                  if (var39 != null) {
                     if (var35 != null) {
                        var35.a();
                     }

                     var35 = zama.a(var39.k());
                     double var40 = (double)((float)var26 * (float)var38 + 1.0F);
                     if (var9.f() || var5.u()) {
                        var40 += (double)((float)(var26 / 2.0D));
                     }

                     if (var9.p()) {
                        var40 = (double)(var2.c() + var2.e()) - var40;
                     } else {
                        var40 += (double)var2.c();
                     }

                     double var42 = var39.v();
                     double var44 = var42;
                     double var46 = 0.0D;
                     int var48;
                     zjd var49;
                     double var50;
                     if (var42 >= 0.0D) {
                        for(var48 = 0; var48 < var33; ++var48) {
                           var49 = ((zbcp)var30.get(var48)).D().b(var38);
                           if (var49 != null) {
                              var50 = var49.v();
                              if (var50 > 0.0D) {
                                 var44 += var50;
                              }
                           }
                        }
                     } else {
                        for(var48 = 0; var48 < var33; ++var48) {
                           var49 = ((zbcp)var30.get(var48)).D().b(var38);
                           if (var49 != null) {
                              var50 = var49.v();
                              if (var50 <= 0.0D) {
                                 var44 += var50;
                              }
                           }
                        }
                     }

                     for(var48 = 0; var48 < var30.size(); ++var48) {
                        var49 = ((zbcp)var30.get(var48)).D().b(var38);
                        if (var49 != null) {
                           var50 = var49.v();
                           var46 += Math.abs(var50);
                        }
                     }

                     float var75 = 0.0F;
                     if (var46 != 0.0D) {
                        var75 = (float)Math.abs(var44) * 100.0F / (float)var46 / (float)(var8.z() - var8.D()) * (float)var2.f();
                     }

                     zsp var76 = var1.x();
                     com.aspose.cells.b.a.b.zo var77;
                     if (var76 != null && var76.d() != 2) {
                        var77 = new com.aspose.cells.b.a.b.zo((float)var40, var10);
                        double var51 = 0.0D;
                        double var53 = 0.0D;
                        float var55 = 0.0F;
                        float var56 = 0.0F;
                        if (var76 != null && !var39.a()) {
                           switch(var76.g()) {
                           case 0:
                              double var57 = var76.e().size() > var38 ? var76.a(var76.e().get(var38)) : 0.0D;
                              var51 = var57;
                              var57 = var76.f().size() > var38 ? var76.a(var76.f().get(var38)) : 0.0D;
                              var53 = var57;
                              break;
                           case 1:
                              var51 = var76.c();
                              var53 = var51;
                              break;
                           case 2:
                              var51 = var76.c() * var42 / 100.0D;
                              var53 = -var51;
                           }

                           var53 = var53 * 100.0D / var46;
                           var51 = var51 * 100.0D / var46;
                           var55 = (float)var51 / (float)(var8.z() - var8.D()) * (float)var2.f();
                           var56 = (float)var53 / (float)(var8.z() - var8.D()) * (float)var2.f();
                           if (!var8.p()) {
                              if (var42 < 0.0D) {
                                 var77.b(var77.e() + var75);
                              } else {
                                 var77.b(var77.e() - var75);
                              }
                           } else if (var42 < 0.0D) {
                              var77.b(var77.e() - var75);
                           } else {
                              var77.b(var77.e() + var75);
                           }
                        }

                        if (var32.equals(var1) && !var39.a()) {
                           var76.a(var77, var55, var56);
                        }
                     }

                     if (!var8.p()) {
                        if (var42 < 0.0D) {
                           var75 += var10;
                        } else {
                           var75 = var10 - var75;
                        }
                     } else if (var42 < 0.0D) {
                        var75 = var10 - var75;
                     } else {
                        var75 += var10;
                     }

                     var77 = new com.aspose.cells.b.a.b.zo((float)var40, var75);
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)var77);
                     if (var32.equals(var1)) {
                        if (var18) {
                           zama.a(var0, (float)var40, var75, (float)var40, var3, var19);
                        }

                        com.aspose.cells.b.a.a.ze.a(var29, (Object)var77);
                        if (!var39.a()) {
                           Object[] var78 = new Object[]{var34, var38, var77, var9};
                           com.aspose.cells.b.a.a.ze.a(var23, (Object)var78);
                        }
                     }
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var36, (Object)null);
                     if (var32.equals(var1)) {
                        com.aspose.cells.b.a.a.ze.a(var29, (Object)null);
                     }
                  }
               }

               if (var32.equals(var1)) {
                  if (var35 == null) {
                     var35 = zama.a(var32.z());
                  }

                  a((zn)var0, (zbcp)var32, (List)var36, (com.aspose.cells.b.a.b.zm)var35, (com.aspose.cells.b.a.b.zp)var2);
               }

               if (var35 != null) {
                  var35.a();
               }

               com.aspose.cells.b.a.a.ze.a(var28, (Object)var36);
            }
         }

         for(var31 = 0; var31 < var4; ++var31) {
            boolean var60 = false;
            boolean var61 = false;
            float var62 = 0.0F;
            float var64 = 0.0F;
            float var63 = 0.0F;
            boolean var65 = false;
            boolean var66 = false;
            float var67 = 0.0F;
            float var70 = 0.0F;

            int var41;
            for(var41 = 0; var41 < var28.size(); ++var41) {
               ArrayList var69 = (ArrayList)var28.get(var41);
               if (var69.size() > var31 && var69.get(var31) != null) {
                  com.aspose.cells.b.a.b.zo var43 = (com.aspose.cells.b.a.b.zo)var69.get(var31);
                  var63 = var43.d();
                  if (!var60) {
                     var62 = var43.e();
                     var60 = true;
                  } else if (!var61) {
                     if (var62 < var43.e()) {
                        var64 = var62;
                        var62 = var43.e();
                        var61 = true;
                     } else {
                        var64 = var43.e();
                        var61 = true;
                     }
                  } else {
                     if (var62 < var43.e()) {
                        var62 = var43.e();
                     }

                     if (var64 > var43.e()) {
                        var64 = var43.e();
                     }
                  }

                  if (var41 == 0) {
                     var67 = var43.e();
                     var65 = true;
                  } else if (var41 == var12 - 1) {
                     var70 = var43.e();
                     var66 = true;
                  }
               }
            }

            if (var1.M() && var60 && var61) {
               float[] var68 = new float[]{var63};
               float[] var71 = new float[]{var62};
               var68[0] = var63;
               float[] var73 = new float[]{var64};
               boolean var74 = a(var8.X(), var2, var68, var71, var68, var73);
               var63 = var68[0];
               var62 = var71[0];
               var63 = var68[0];
               var64 = var73[0];
               if (var74) {
                  zama.a(var0, var63, var62, var63, var64, var20);
               }
            }

            if (var1.N() && var65 && var66) {
               var41 = (int)(var26 / (double)(1.0F + var13));
               com.aspose.cells.b.a.b.zq var72 = new com.aspose.cells.b.a.b.zq();
               if (var67 <= var70) {
                  var72.c((float)var41);
                  var72.d(var70 - var67);
                  var72.a(var63 - var72.h() / 2.0F);
                  var72.b(var67);
                  a(var0, var22, var72);
               } else {
                  var72.c((float)var41);
                  var72.d(var67 - var70);
                  var72.a(var63 - var72.h() / 2.0F);
                  var72.b(var70);
                  a(var0, var21, var72);
               }
            }
         }

         a(var0, var1, (List)var29, (com.aspose.cells.b.a.b.zp)var2);
         return var23;
      }
   }

   private static ArrayList b(zn var0, zbcp var1, com.aspose.cells.b.a.b.zp var2, float var3) throws Exception {
      zif var4 = var1.v();
      int[] var5 = new int[]{39, 42};
      int var6 = var1.af();
      zbcr var7 = var4.z();
      int var8 = var7.getCount();
      float var9 = (float)var1.K() / 100.0F;
      float var10 = (float)var1.J() / 100.0F;
      zbo var11;
      zbo var12;
      ArrayList var13;
      if (var6 == 1) {
         var12 = var4.e();
         var11 = var4.E();
         var13 = zhz.a((List)var4.z().c(), var1.v().S());
      } else {
         var12 = var4.g();
         var11 = var4.G();
         var13 = zhz.a((List)var4.z().d(), var1.v().S());
      }

      float var14 = 0.0F;
      if (!var11.p()) {
         var14 = (float)var2.d() + (float)var11.z() / (float)(var11.z() - var11.D()) * (float)var2.f();
      } else {
         var14 = (float)var2.j() - (float)var11.z() / (float)(var11.z() - var11.D()) * (float)var2.f();
      }

      double var15 = var11.D();
      double var17 = var11.z();
      boolean var19 = var1.L();
      zalv var20 = var1.O();
      zalv var21 = var1.P();
      ziw var22 = var1.S();
      ziw var23 = var1.T();
      int var24 = var13.size();
      int var25 = var12.j();
      int var26 = (int)var12.D();
      int var27 = (int)var12.z();
      boolean var28 = false;
      int var65;
      if (!var12.f() && !var4.u()) {
         var65 = zbq.a(var25, var27, var26, var1.v().S());
         if (var65 == 0) {
            var65 = 1;
         }
      } else {
         var65 = zbq.a(var25, var27, var26, var1.v().S()) + 1;
      }

      double var29 = (double)var2.e() / (double)var65;
      float var31 = 0.0F;
      ArrayList var32 = new ArrayList();
      ArrayList var33 = new ArrayList();
      ArrayList var34 = new ArrayList();
      List var35 = var7.a(var6, var5);

      int var36;
      for(var36 = 0; var36 < var35.size(); ++var36) {
         zbcp var37 = (zbcp)var35.get(var36);
         if ((!var4.an() || var37.equals(var1)) && (var1.N() || var1.M() || var37.equals(var1))) {
            int var38 = var7.a(var37, var6, var5);
            int var39 = var37.ai();
            com.aspose.cells.b.a.b.zm var40 = null;
            ArrayList var41 = new ArrayList();

            for(int var42 = 0; var42 < var24; ++var42) {
               zjd var43 = var37.D().b(var42);
               if (var43 != null) {
                  if (var40 != null) {
                     var40.a();
                  }

                  var40 = zama.a(var43.k());
                  int var44 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var13.get(var42)));
                  var44 = zbq.a(var25, var44, var1.v().S());
                  int var45 = zbq.a(var25, var44, var26, var1.v().S());
                  float var46 = (float)(var29 * (double)var45);
                  var31 = (float)(var29 * (double)zbq.a(var25, zbq.a(var12.j(), var12.y(), (int)var12.x(), var44, var1.v().S()), var44, var1.v().S()));
                  if (var12.f() || var4.u()) {
                     var46 += (float)(var29 / 2.0D);
                  }

                  float var47 = 0.0F;
                  if (var12.p()) {
                     var47 = (float)(var2.c() + var2.e()) - var46;
                  } else {
                     var47 = (float)var2.c() + var46;
                  }

                  double var48 = var43.v();
                  double var50 = var48;
                  double var52 = 0.0D;
                  int var54;
                  zjd var55;
                  double var56;
                  if (var48 >= 0.0D) {
                     for(var54 = 0; var54 < var38; ++var54) {
                        var55 = ((zbcp)var35.get(var54)).D().b(var42);
                        if (var55 != null) {
                           var56 = var55.v();
                           if (var56 > 0.0D) {
                              var50 += var56;
                           }
                        }
                     }
                  } else {
                     for(var54 = 0; var54 < var38; ++var54) {
                        var55 = ((zbcp)var35.get(var54)).D().b(var42);
                        if (var55 != null) {
                           var56 = var55.v();
                           if (var56 <= 0.0D) {
                              var50 += var56;
                           }
                        }
                     }
                  }

                  for(var54 = 0; var54 < var35.size(); ++var54) {
                     var55 = ((zbcp)var35.get(var54)).D().b(var42);
                     if (var55 != null) {
                        var56 = var55.v();
                        var52 += Math.abs(var56);
                     }
                  }

                  if (var52 != 0.0D) {
                     float var82 = (float)Math.abs(var50) * 100.0F / (float)var52 / (float)(var11.z() - var11.D()) * (float)var2.f();
                     zsp var83 = var1.x();
                     com.aspose.cells.b.a.b.zo var84;
                     if (var83 != null && var83.d() != 2 && var37.equals(var1)) {
                        var84 = new com.aspose.cells.b.a.b.zo(var47, var14);
                        double var57 = 0.0D;
                        double var59 = 0.0D;
                        float var61 = 0.0F;
                        float var62 = 0.0F;
                        if (var83 != null && !var43.a()) {
                           switch(var83.g()) {
                           case 0:
                              double var63 = var83.e().size() > var42 ? var83.a(var83.e().get(var42)) : 0.0D;
                              var57 = var63;
                              var63 = var83.f().size() > var42 ? var83.a(var83.f().get(var42)) : 0.0D;
                              var59 = var63;
                              break;
                           case 1:
                              var57 = var83.c();
                              var59 = var57;
                              break;
                           case 2:
                              var57 = var83.c() * var48 / 100.0D;
                              var59 = -var57;
                           }

                           var59 = var59 * 100.0D / var52;
                           var57 = var57 * 100.0D / var52;
                           var61 = (float)var57 / (float)(var11.z() - var11.D()) * (float)var2.f();
                           var62 = (float)var59 / (float)(var11.z() - var11.D()) * (float)var2.f();
                           if (!var11.p()) {
                              if (var48 < 0.0D) {
                                 var84.b(var84.e() + var82);
                              } else {
                                 var84.b(var84.e() - var82);
                              }
                           } else if (var48 < 0.0D) {
                              var84.b(var84.e() - var82);
                           } else {
                              var84.b(var84.e() + var82);
                           }
                        }

                        if (var37.equals(var1) && !var43.a()) {
                           var83.a(var84, var61, var62);
                        }
                     }

                     if (!var11.p()) {
                        if (var48 < 0.0D) {
                           var82 += var14;
                        } else {
                           var82 = var14 - var82;
                        }
                     } else if (var48 < 0.0D) {
                        var82 = var14 - var82;
                     } else {
                        var82 += var14;
                     }

                     var84 = new com.aspose.cells.b.a.b.zo(var47, var82);
                     if (var41.size() == 0) {
                        com.aspose.cells.b.a.a.ze.a(var41, (Object)var84);
                     } else {
                        a(var84, var41, var12.p());
                     }

                     if (var37.equals(var1)) {
                        if (var19) {
                           zama.a(var0, var47, var82, var47, var3, var20);
                        }

                        com.aspose.cells.b.a.a.ze.a(var34, (Object)var84);
                        if (!var43.a()) {
                           Object[] var85 = new Object[]{var39, var42, var84, var12};
                           com.aspose.cells.b.a.a.ze.a(var32, (Object)var85);
                        }
                     }
                  }
               } else {
                  if (var12.p()) {
                     var41.add(0, (Object)null);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var41, (Object)null);
                  }

                  if (var37.equals(var1)) {
                     com.aspose.cells.b.a.a.ze.a(var34, (Object)null);
                  }
               }
            }

            if (var37.equals(var1)) {
               if (var40 == null) {
                  var40 = zama.a(var37.z());
               }

               a((zn)var0, (zbcp)var37, (List)var41, (com.aspose.cells.b.a.b.zm)var40, (com.aspose.cells.b.a.b.zp)var2);
            }

            if (var40 != null) {
               var40.a();
            }

            com.aspose.cells.b.a.a.ze.a(var33, (Object)var41);
         }
      }

      for(var36 = 0; var36 < var24; ++var36) {
         boolean var66 = false;
         boolean var67 = false;
         float var68 = 0.0F;
         float var70 = 0.0F;
         float var69 = 0.0F;
         boolean var71 = false;
         boolean var72 = false;
         float var73 = 0.0F;
         float var74 = 0.0F;

         int var75;
         for(var75 = 0; var75 < var33.size(); ++var75) {
            ArrayList var78 = (ArrayList)var33.get(var75);
            if (var78.size() > var36 && var78.get(var36) != null) {
               com.aspose.cells.b.a.b.zo var77 = (com.aspose.cells.b.a.b.zo)var78.get(var36);
               var69 = var77.d();
               if (!var66) {
                  var68 = var77.e();
                  var66 = true;
               } else if (!var67) {
                  if (var68 < var77.e()) {
                     var70 = var68;
                     var68 = var77.e();
                     var67 = true;
                  } else {
                     var70 = var77.e();
                     var67 = true;
                  }
               } else {
                  if (var68 < var77.e()) {
                     var68 = var77.e();
                  }

                  if (var70 > var77.e()) {
                     var70 = var77.e();
                  }
               }

               if (var75 == 0) {
                  var73 = var77.e();
                  var71 = true;
               } else if (var75 == var8 - 1) {
                  var74 = var77.e();
                  var72 = true;
               }
            }
         }

         if (var1.M() && var66 && var67) {
            float[] var76 = new float[]{var69};
            float[] var80 = new float[]{var68};
            var76[0] = var69;
            float[] var79 = new float[]{var70};
            boolean var49 = a(var11.X(), var2, var76, var80, var76, var79);
            var69 = var76[0];
            var68 = var80[0];
            var69 = var76[0];
            var70 = var79[0];
            if (var49) {
               zama.a(var0, var69, var68, var69, var70, var21);
            }
         }

         if (var1.N() && var71 && var72) {
            var75 = (int)(var31 / (1.0F + var10));
            com.aspose.cells.b.a.b.zq var81 = new com.aspose.cells.b.a.b.zq();
            if (var73 <= var74) {
               var81.c((float)var75);
               var81.d(var74 - var73);
               var81.a(var69 - var81.h() / 2.0F);
               var81.b(var73);
               a(var0, var23, var81);
            } else {
               var81.c((float)var75);
               var81.d(var73 - var74);
               var81.a(var69 - var81.h() / 2.0F);
               var81.b(var74);
               a(var0, var22, var81);
            }
         }
      }

      a(var0, var1, (List)var34, (com.aspose.cells.b.a.b.zp)var2);
      return var32;
   }

   static void a(zn var0, zif var1, float var2, double var3, int var5) throws Exception {
      zbcr var6 = var1.z();
      int var7 = var6.getCount();
      zbo var8 = var1.E();
      zbo var9 = var1.e();
      if (var9.k() == 2) {
         a(var0, var1, var2, var3);
      } else {
         ArrayList var10 = new ArrayList();
         float var11 = var1.N().g() / (float)var5;
         float var12 = var1.N().a(false, var5, var7);
         float var13 = var1.N().k();
         float var14 = var12 * (float)var1.o() / 100.0F;
         double var15 = 1.0D;

         for(int var17 = 0; var17 < var5; ++var17) {
            int var18 = var17;
            if (var1.D() > 180) {
               var18 = var5 - 1 - var17;
            }

            ArrayList var19 = var6.j();

            for(int var20 = 0; var20 < var19.size(); ++var20) {
               int var21 = var20;
               if (var1.D() > 180) {
                  var21 = var19.size() - 1 - var20;
               }

               zbcp var22 = (zbcp)var19.get(var21);
               int var23 = var22.ai();
               float var24 = (float)var21 * var12;
               float var25 = var11 * (float)var18 + var14 / 2.0F + var24;
               var25 += var1.N().e();
               zjf var26 = var22.D();
               int var27 = var18;
               if (var9.p()) {
                  var27 = var5 - 1 - var18;
               }

               zjd var28 = var26.b(var27);
               if (var28 != null && !var28.a() && !var28.H()) {
                  double var29 = var8.g(var28.v());
                  float var31 = (float)((var3 - var29) / (var8.z() - var8.D()) * (double)var1.N().i());
                  if (var8.p()) {
                     var31 = -var31;
                  }

                  double[] var32 = new double[]{var15};
                  a(var0, var28, var1, var25, var12, var13, var2, var31, Double.NaN, var32);
                  var15 = var32[0];
                  com.aspose.cells.b.a.b.zo var33 = a(var1, var25, var12, var2, var31);
                  Object[] var34 = new Object[]{var23, var27, var33};
                  com.aspose.cells.b.a.a.ze.a(var10, (Object)var34);
               }
            }
         }

         c(var0, var1, var10);
      }
   }

   private static void a(zn var0, zif var1, float var2, double var3) throws Exception {
      zbcr var5 = var1.z();
      int var6 = var5.getCount();
      zbo var7 = var1.E();
      zbo var8 = var1.e();
      ArrayList var9 = new ArrayList();
      int var10 = (int)var8.z();
      int var11 = (int)var8.D();
      int var12 = var8.j();
      int var13 = zbq.a(var12, var10, var11, var1.S()) + 1;
      float var14 = var1.N().g() / (float)var13;
      float var15 = var1.N().a(false, var13, var6);
      float var16 = var1.N().k();
      float var17 = var15 * (float)var1.o() / 100.0F;
      ArrayList var18 = zhz.a((List)var1.z().c(), var1.S());
      int var19 = var18.size();

      for(int var20 = 0; var20 < var19; ++var20) {
         int var21 = var20;
         if (var1.D() > 180) {
            var21 = var19 - 1 - var20;
         }

         int var22 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var18.get(var21)));
         var22 = zbq.a(var12, var22, var1.S());
         int var23 = zbq.a(var12, var22, (int)var8.D(), var1.S());
         float var24 = var14 * (float)var23;
         var24 += var1.N().e() + var17 / 2.0F;
         ArrayList var25 = var5.j();
         double var26 = 1.0D;

         for(int var28 = 0; var28 < var25.size(); ++var28) {
            int var29 = var28;
            if (var1.D() > 180) {
               var29 = var25.size() - 1 - var28;
            }

            zbcp var30 = (zbcp)var25.get(var29);
            int var31 = var30.ai();
            float var32 = (float)var29 * var15;
            float var33 = var24 + var32;
            zjf var34 = var30.D();
            int var35 = var21;
            if (var8.p()) {
               var35 = var19 - 1 - var21;
            }

            zjd var36 = var34.b(var35);
            if (var36 != null && !var36.a() && !var36.H()) {
               double var37 = var7.g(var36.v());
               float var39 = (float)((var3 - var37) / (var7.z() - var7.D()) * (double)var1.N().i());
               if (var7.p()) {
                  var39 = -var39;
               }

               double[] var40 = new double[]{var26};
               a(var0, var36, var1, var33, var15, var16, var2, var39, Double.NaN, var40);
               var26 = var40[0];
               com.aspose.cells.b.a.b.zo var41 = a(var1, var33, var15, var2, var39);
               Object[] var42 = new Object[]{var31, var35, var41};
               com.aspose.cells.b.a.a.ze.a(var9, (Object)var42);
            }
         }
      }

      c(var0, var1, var9);
   }

   static void a(zn var0, zif var1, double var2, int var4) throws Exception {
      zbcr var5 = var1.z();
      zbo var6 = var1.E();
      zbo var7 = var1.e();
      ArrayList var8 = var5.j();
      int var9 = zhz.a(var8, var6);
      double var10 = 0.0D;
      if (var9 == 1) {
         var10 = var6.D();
      } else if (var9 == 2) {
         var10 = var6.z();
      }

      float var12 = 0.0F;
      if (var1.E().p()) {
         var12 = var1.N().f() - (float)Math.abs((var6.z() - var10) / (double)((float)(var6.z() - var6.D()))) * var1.N().i();
      } else {
         var12 = var1.N().f() - (float)Math.abs((var6.D() - var10) / (double)((float)(var6.z() - var6.D()))) * var1.N().i();
      }

      if (var7.k() == 2) {
         a(var0, var1, var12, var2, var9, var10);
      } else {
         ArrayList var13 = new ArrayList();
         float var14 = var1.N().g() / (float)var4;
         float var15 = var1.N().a(false, var4, 1);
         float var16 = var1.N().k();
         float var17 = var15 * (float)var1.o() / 100.0F;

         for(int var18 = 0; var18 < var4; ++var18) {
            int var19 = var18;
            if (var1.D() > 180) {
               var19 = var4 - 1 - var18;
            }

            float var20 = var1.N().e() + var14 * (float)var19 + var17 / 2.0F;
            ArrayList var21 = new ArrayList();

            int var24;
            for(int var22 = 0; var22 < var8.size(); ++var22) {
               zbcp var23 = (zbcp)var8.get(var22);
               var24 = var23.ai();
               zjf var25 = var23.D();
               int var26 = var19;
               if (var7.p()) {
                  var26 = var4 - 1 - var19;
               }

               zjd var27 = var25.b(var26);
               if (var27 != null && !var27.a() && !var27.H()) {
                  double var29 = var27.v();
                  double var31 = 0.0D;
                  double[] var33 = new double[]{var29};
                  double[] var34 = new double[]{var31};
                  boolean var35 = zjl.a(var33, var34, var8, var22, var26, var6.z(), var6.D());
                  var29 = var33[0];
                  var31 = var34[0];
                  if (var35) {
                     if (var9 == 1 && var22 == 0) {
                        var29 -= var10;
                     } else if (var9 == 2 && var22 == 0) {
                        var29 -= var10;
                     }

                     float var36 = (float)(var29 / (var6.z() - var6.D()) * (double)var1.N().i());
                     float var37 = (float)((var31 - var10) / (var6.z() - var6.D()) * (double)var1.N().i());
                     float var38;
                     if (var6.p()) {
                        var38 = var12 + (var37 - var36);
                     } else {
                        var38 = var12 - (var37 - var36);
                        var36 = -var36;
                     }

                     float var39 = var38 + var36;
                     if (var38 > var1.N().f()) {
                        var38 = var1.N().f();
                     }

                     if (var38 < var1.N().f() - var1.N().i()) {
                        var38 = var1.N().f() - var1.N().i();
                     }

                     if (var39 > var1.N().f()) {
                        var39 = var1.N().f();
                     }

                     if (var39 < var1.N().f() - var1.N().i()) {
                        var39 = var1.N().f() - var1.N().i();
                     }

                     var36 = var39 - var38;
                     Object[] var40 = new Object[]{var27, var20, var38, var36, var31};
                     a(var29, var40, var21, var6);
                     com.aspose.cells.b.a.b.zo var41 = a(var1, var20, var15, var16, var38, var36);
                     Object[] var42 = new Object[]{var24, var26, var41};
                     com.aspose.cells.b.a.a.ze.a(var13, (Object)var42);
                  }
               }
            }

            double var43 = 1.0D;

            for(var24 = 0; var24 < var21.size(); ++var24) {
               Object[] var44 = (Object[])((Object[])var21.get(var24));
               zjd var45 = (zjd)var44[0];
               double[] var46 = new double[]{var43};
               a(var0, var45, var1, (Float)var44[1], var15, var16, (Float)var44[2], (Float)var44[3], (Double)var44[4], var46);
               var43 = var46[0];
            }

            var21.clear();
            c(var0, var1, var13);
            var13.clear();
         }

      }
   }

   private static void a(zn var0, zif var1, float var2, double var3, int var5, double var6) throws Exception {
      zbcr var8 = var1.z();
      zbo var9 = var1.E();
      zbo var10 = var1.e();
      ArrayList var11 = new ArrayList();
      int var12 = (int)var10.z();
      int var13 = (int)var10.D();
      int var14 = var10.j();
      int var15 = zbq.a(var14, var12, var13, var1.S()) + 1;
      float var16 = var1.N().g() / (float)var15;
      float var17 = var1.N().a(false, var15, 1);
      float var18 = var1.N().k();
      float var19 = var17 * (float)var1.o() / 100.0F;
      ArrayList var20 = zhz.a((List)var1.z().c(), var1.S());
      int var21 = var20.size();

      for(int var22 = 0; var22 < var21; ++var22) {
         int var23 = var22;
         if (var1.D() > 180) {
            var23 = var21 - 1 - var22;
         }

         int var24 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var20.get(var23)));
         var24 = zbq.a(var14, var24, var1.S());
         int var25 = zbq.a(var14, var24, (int)var10.D(), var1.S());
         float var26 = var16 * (float)var25;
         float var27 = var1.N().e() + var19 / 2.0F + var26;
         ArrayList var28 = new ArrayList();
         ArrayList var29 = var8.j();

         int var32;
         for(int var30 = 0; var30 < var29.size(); ++var30) {
            zbcp var31 = (zbcp)var29.get(var30);
            var32 = var31.ai();
            zjf var33 = var31.D();
            int var34 = var23;
            if (var10.p()) {
               var34 = var21 - 1 - var23;
            }

            zjd var35 = var33.b(var34);
            if (var35 != null && !var35.a() && !var35.H()) {
               double var37 = var35.v();
               double var39 = 0.0D;
               double[] var41 = new double[]{var37};
               double[] var42 = new double[]{var39};
               boolean var43 = zjl.a(var41, var42, var29, var30, var34, var9.z(), var9.D());
               var37 = var41[0];
               var39 = var42[0];
               if (var43) {
                  if (var5 == 1 && var30 == 0) {
                     var37 -= var6;
                  } else if (var5 == 2 && var30 == 0) {
                     var37 -= var6;
                  }

                  float var44 = (float)(var37 / (var9.z() - var9.D()) * (double)var1.N().i());
                  float var45 = (float)((var39 - var6) / (var9.z() - var9.D()) * (double)var1.N().i());
                  float var46;
                  if (var9.p()) {
                     var46 = var2 + (var45 - var44);
                  } else {
                     var46 = var2 - (var45 - var44);
                     var44 = -var44;
                  }

                  float var47 = var46 + var44;
                  if (var46 > var1.N().f()) {
                     var46 = var1.N().f();
                  }

                  if (var46 < var1.N().f() - var1.N().i()) {
                     var46 = var1.N().f() - var1.N().i();
                  }

                  if (var47 > var1.N().f()) {
                     var47 = var1.N().f();
                  }

                  if (var47 < var1.N().f() - var1.N().i()) {
                     var47 = var1.N().f() - var1.N().i();
                  }

                  var44 = var47 - var46;
                  Object[] var48 = new Object[]{var35, var27, var46, var44, var39};
                  a(var37, var48, var28, var9);
                  com.aspose.cells.b.a.b.zo var49 = a(var1, var27, var17, var18, var46, var44);
                  Object[] var50 = new Object[]{var32, var34, var49};
                  com.aspose.cells.b.a.a.ze.a(var11, (Object)var50);
               }
            }
         }

         double var51 = 1.0D;

         for(var32 = 0; var32 < var28.size(); ++var32) {
            Object[] var52 = (Object[])((Object[])var28.get(var32));
            zjd var53 = (zjd)var52[0];
            double[] var54 = new double[]{var51};
            a(var0, var53, var1, (Float)var52[1], var17, var18, (Float)var52[2], (Float)var52[3], (Double)var52[4], var54);
            var51 = var54[0];
         }

         var28.clear();
         c(var0, var1, var11);
         var11.clear();
      }

   }

   static void b(zn var0, zif var1, double var2, int var4) throws Exception {
      zbcr var5 = var1.z();
      zbo var6 = var1.E();
      zbo var7 = var1.e();
      float var8 = 0.0F;
      if (var1.E().p()) {
         var8 = var1.N().f() - (float)Math.abs(var6.z() / (double)((float)(var6.z() - var6.D()))) * var1.N().i();
      } else {
         var8 = var1.N().f() - var1.N().i() + (float)Math.abs(var6.z() / (double)((float)(var6.z() - var6.D()))) * var1.N().i();
      }

      if (var7.k() == 2) {
         b(var0, var1, var8, var2);
      } else {
         ArrayList var9 = new ArrayList();
         float var10 = var1.N().g() / (float)var4;
         float var11 = var1.N().a(false, var4, 1);
         float var12 = var1.N().k();
         float var13 = var11 * (float)var1.o() / 100.0F;

         for(int var14 = 0; var14 < var4; ++var14) {
            int var15 = var14;
            if (var1.D() > 180) {
               var15 = var4 - 1 - var14;
            }

            float var16 = var1.N().e() + var10 * (float)var15 + var13 / 2.0F;
            ArrayList var17 = new ArrayList();
            ArrayList var18 = var5.j();

            int var21;
            for(int var19 = 0; var19 < var18.size(); ++var19) {
               zbcp var20 = (zbcp)var18.get(var19);
               var21 = var20.ai();
               zjf var22 = var20.D();
               int var23 = var15;
               if (var7.p()) {
                  var23 = var4 - 1 - var15;
               }

               zjd var24 = var22.b(var23);
               if (var24 != null && !var24.a() && !var24.H()) {
                  double var26 = zjl.a(var18, var23);
                  if (var26 != 0.0D) {
                     double var28 = var24.v();
                     double[] var32 = new double[]{var28};
                     double[] var33 = new double[]{var28};
                     boolean var34 = zjl.a(var32, var33, var18, var19, var23, var6, var26);
                     var28 = var32[0];
                     double var30 = var33[0];
                     if (var34) {
                        float var35 = (float)(var28 * 100.0D / var26 / (var6.z() - var6.D()) * (double)var1.N().i());
                        float var36 = (float)(var30 * 100.0D / var26 / (var6.z() - var6.D()) * (double)var1.N().i());
                        float var37;
                        if (var6.p()) {
                           var37 = var8 + (var36 - var35);
                        } else {
                           var37 = var8 - (var36 - var35);
                           var35 = -var35;
                        }

                        float var38 = var37 + var35;
                        if (var37 > var1.N().f()) {
                           var37 = var1.N().f();
                        }

                        if (var37 < var1.N().f() - var1.N().i()) {
                           var37 = var1.N().f() - var1.N().i();
                        }

                        if (var38 > var1.N().f()) {
                           var38 = var1.N().f();
                        }

                        if (var38 < var1.N().f() - var1.N().i()) {
                           var38 = var1.N().f() - var1.N().i();
                        }

                        var35 = var38 - var37;
                        Object[] var39 = new Object[]{var24, var16, var37, var35, var30};
                        a(var28, var39, var17, var6);
                        com.aspose.cells.b.a.b.zo var40 = a(var1, var16, var11, var12, var37, var35);
                        Object[] var41 = new Object[]{var21, var23, var40};
                        com.aspose.cells.b.a.a.ze.a(var9, (Object)var41);
                     }
                  }
               }
            }

            double var42 = 1.0D;

            for(var21 = 0; var21 < var17.size(); ++var21) {
               Object[] var43 = (Object[])((Object[])var17.get(var21));
               zjd var44 = (zjd)var43[0];
               double[] var45 = new double[]{var42};
               a(var0, var44, var1, (Float)var43[1], var11, var12, (Float)var43[2], (Float)var43[3], (Double)var43[4], var45);
               var42 = var45[0];
            }

            var17.clear();
            c(var0, var1, var9);
            var9.clear();
         }

      }
   }

   private static void b(zn var0, zif var1, float var2, double var3) throws Exception {
      zbcr var5 = var1.z();
      zbo var6 = var1.E();
      zbo var7 = var1.e();
      ArrayList var8 = new ArrayList();
      int var9 = (int)var7.z();
      int var10 = (int)var7.D();
      int var11 = var7.j();
      int var12 = zbq.a(var11, var9, var10, var1.S()) + 1;
      float var13 = var1.N().g() / (float)var12;
      float var14 = var1.N().a(false, var12, 1);
      float var15 = var1.N().k();
      float var16 = var14 * (float)var1.o() / 100.0F;
      ArrayList var17 = zhz.a((List)var1.z().c(), var1.S());
      int var18 = var17.size();

      for(int var19 = 0; var19 < var18; ++var19) {
         int var20 = var19;
         if (var1.D() > 180) {
            var20 = var18 - 1 - var19;
         }

         int var21 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var17.get(var20)));
         var21 = zbq.a(var11, var21, var1.S());
         int var22 = zbq.a(var11, var21, (int)var7.D(), var1.S());
         float var23 = var13 * (float)var22;
         float var24 = var1.N().e() + var16 / 2.0F + var23;
         ArrayList var25 = new ArrayList();
         ArrayList var26 = var5.j();

         int var29;
         for(int var27 = 0; var27 < var26.size(); ++var27) {
            zbcp var28 = (zbcp)var26.get(var27);
            var29 = var28.ai();
            zjf var30 = var28.D();
            int var31 = var20;
            if (var7.p()) {
               var31 = var18 - 1 - var20;
            }

            zjd var32 = var30.b(var31);
            if (var32 != null && !var32.a() && !var32.H()) {
               double var34 = zjl.a(var26, var31);
               if (var34 != 0.0D) {
                  double var36 = var32.v();
                  double[] var40 = new double[]{var36};
                  double[] var41 = new double[]{var36};
                  boolean var42 = zjl.a(var40, var41, var26, var27, var31, var6, var34);
                  var36 = var40[0];
                  double var38 = var41[0];
                  if (var42) {
                     float var43 = (float)(var36 * 100.0D / var34 / (var6.z() - var6.D()) * (double)var1.N().i());
                     float var44 = (float)(var38 * 100.0D / var34 / (var6.z() - var6.D()) * (double)var1.N().i());
                     float var45;
                     if (var6.p()) {
                        var45 = var2 + (var44 - var43);
                     } else {
                        var45 = var2 - (var44 - var43);
                        var43 = -var43;
                     }

                     float var46 = var45 + var43;
                     if (var45 > var1.N().f()) {
                        var45 = var1.N().f();
                     }

                     if (var45 < var1.N().f() - var1.N().i()) {
                        var45 = var1.N().f() - var1.N().i();
                     }

                     if (var46 > var1.N().f()) {
                        var46 = var1.N().f();
                     }

                     if (var46 < var1.N().f() - var1.N().i()) {
                        var46 = var1.N().f() - var1.N().i();
                     }

                     var43 = var46 - var45;
                     Object[] var47 = new Object[]{var32, var24, var45, var43, var38};
                     a(var36, var47, var25, var6);
                     com.aspose.cells.b.a.b.zo var48 = a(var1, var24, var14, var15, var45, var43);
                     Object[] var49 = new Object[]{var29, var31, var48};
                     com.aspose.cells.b.a.a.ze.a(var8, (Object)var49);
                  }
               }
            }
         }

         double var50 = 1.0D;

         for(var29 = 0; var29 < var25.size(); ++var29) {
            Object[] var51 = (Object[])((Object[])var25.get(var29));
            zjd var52 = (zjd)var51[0];
            double[] var53 = new double[]{var50};
            a(var0, var52, var1, (Float)var51[1], var14, var15, (Float)var51[2], (Float)var51[3], (Double)var51[4], var53);
            var50 = var53[0];
         }

         var25.clear();
         c(var0, var1, var8);
         var8.clear();
      }

   }

   static void b(zn var0, zif var1, float var2, double var3, int var5) throws Exception {
      zbcr var6 = var1.z();
      int var7 = var6.getCount();
      zbo var8 = var1.E();
      zbo var9 = var1.e();
      if (var9.k() == 2) {
         c(var0, var1, var2, var3);
      } else {
         float var10 = (float)var1.m() / 100.0F;
         float var11 = (float)var1.n() / 100.0F;
         float var12 = (float)var1.o() / 100.0F;
         ArrayList var13 = new ArrayList();
         float var14 = var1.N().g() / (float)var5;
         float var15 = var14 / (1.0F + var12);
         float var16 = var15 * var12;
         float var17 = var14 * var10 / (1.0F + var11);
         ArrayList var18 = var6.j();
         int var19;
         int var20;
         int var22;
         int var24;
         int var27;
         zjd var28;
         double var29;
         float var31;
         com.aspose.cells.b.a.b.zo var32;
         Object[] var33;
         if ((var1.D() < 0 || var1.D() >= 90) && (var1.D() < 180 || var1.D() >= 270)) {
            if (var1.D() >= 90 && var1.D() < 180 || var1.D() >= 270 && var1.D() < 360) {
               for(var19 = 0; var19 < var5; ++var19) {
                  var20 = var19;
                  if (var1.D() >= 270 && var1.D() < 360) {
                     var20 = var5 - 1 - var19;
                  }

                  for(int var34 = 0; var34 < var18.size(); ++var34) {
                     var22 = var34;
                     if (var1.D() >= 270 && var1.D() < 360) {
                        var22 = var18.size() - 1 - var34;
                     }

                     if (var1.I().p()) {
                        var22 = var18.size() - 1 - var22;
                     }

                     zbcp var35 = (zbcp)var18.get(var22);
                     var24 = var35.ai();
                     float var36 = var14 * (float)var20 + var16 / 2.0F;
                     var36 += var1.N().e();
                     zjf var37 = var35.D();
                     var27 = var20;
                     if (var9.p()) {
                        var27 = var5 - 1 - var20;
                     }

                     var28 = var37.b(var27);
                     if (var28 != null && !var28.a()) {
                        var29 = var8.g(var28.v());
                        var31 = (float)((var3 - var29) / (var8.z() - var8.D()) * (double)var1.N().i());
                        if (var8.p()) {
                           var31 = -var31;
                        }

                        a(var0, var28, var1, var2, var31, var36, var15, var17, var24 + 1, var18.size());
                        var32 = a(var1, var2, var31, var36, var15, var17, var24 + 1, var18.size());
                        var13.clear();
                        var33 = new Object[]{var24, var27, var32};
                        com.aspose.cells.b.a.a.ze.a(var13, (Object)var33);
                        c(var0, var1, var13);
                     }
                  }
               }
            }
         } else {
            for(var19 = 0; var19 < var18.size(); ++var19) {
               var20 = var18.size() - 1 - var19;
               if (var1.D() >= 180 && var1.D() < 270) {
                  var20 = var18.size() - 1 - var20;
               }

               if (var1.I().p()) {
                  var20 = var18.size() - 1 - var20;
               }

               zbcp var21 = (zbcp)var18.get(var20);
               var22 = var21.ai();
               zjf var23 = var21.D();

               for(var24 = 0; var24 < var5; ++var24) {
                  int var25 = var24;
                  if (var1.D() >= 180 && var1.D() < 270) {
                     var25 = var5 - 1 - var24;
                  }

                  float var26 = var14 * (float)var25 + var16 / 2.0F;
                  var26 += var1.N().e();
                  var27 = var25;
                  if (var9.p()) {
                     var27 = var5 - 1 - var25;
                  }

                  var28 = var23.b(var27);
                  if (var28 != null && !var28.a() && !var28.H()) {
                     var29 = var8.g(var28.v());
                     var31 = (float)((var3 - var29) / (var8.z() - var8.D()) * (double)var1.N().i());
                     if (var8.p()) {
                        var31 = -var31;
                     }

                     a(var0, var28, var1, var2, var31, var26, var15, var17, var22 + 1, var18.size());
                     var32 = a(var1, var2, var31, var26, var15, var17, var22 + 1, var18.size());
                     var13.clear();
                     var33 = new Object[]{var22, var27, var32};
                     com.aspose.cells.b.a.a.ze.a(var13, (Object)var33);
                     c(var0, var1, var13);
                  }
               }
            }
         }

      }
   }

   private static void c(zn var0, zif var1, float var2, double var3) throws Exception {
      zbcr var5 = var1.z();
      int var6 = var5.getCount();
      zbo var7 = var1.E();
      zbo var8 = var1.e();
      zbo var9 = var1.I();
      float var10 = (float)var1.m() / 100.0F;
      float var11 = (float)var1.n() / 100.0F;
      float var12 = (float)var1.o() / 100.0F;
      ArrayList var13 = new ArrayList();
      int var14 = (int)var8.z();
      int var15 = (int)var8.D();
      int var16 = var8.j();
      int var17 = zbq.a(var16, var14, var15, var1.S()) + 1;
      float var18 = var1.N().g() / (float)var17;
      float var19 = var18 / (1.0F + var12);
      float var20 = var19 * var12;
      float var21 = var18 * var10 / (1.0F + var11);
      ArrayList var22 = var5.j();
      ArrayList var23 = zhz.a((List)var1.z().c(), var1.S());
      int var24 = var23.size();
      int var25;
      int var26;
      int var28;
      int var31;
      int var32;
      int var36;
      zjd var37;
      double var38;
      float var40;
      com.aspose.cells.b.a.b.zo var41;
      Object[] var42;
      if ((var1.D() < 0 || var1.D() >= 90) && (var1.D() < 180 || var1.D() >= 270)) {
         if (var1.D() >= 90 && var1.D() < 180 || var1.D() >= 270 && var1.D() < 360) {
            for(var25 = 0; var25 < var24; ++var25) {
               var26 = var25;
               if (var1.D() >= 270 && var1.D() < 360) {
                  var26 = var24 - 1 - var25;
               }

               int var43 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var23.get(var26)));
               var43 = zbq.a(var16, var43, var1.S());
               var28 = zbq.a(var16, var43, (int)var8.D(), var1.S());
               float var44 = var18 * (float)var28;
               float var45 = var1.N().e() + var44 + var20 / 2.0F;

               for(var31 = 0; var31 < var22.size(); ++var31) {
                  var32 = var31;
                  if (var1.D() >= 270 && var1.D() < 360) {
                     var32 = var22.size() - 1 - var31;
                  }

                  if (var9.p()) {
                     var32 = var22.size() - 1 - var32;
                  }

                  zbcp var46 = (zbcp)var22.get(var32);
                  int var47 = var46.ai();
                  zjf var48 = var46.D();
                  var36 = var26;
                  if (var8.p()) {
                     var36 = var24 - 1 - var26;
                  }

                  var37 = var48.b(var36);
                  if (var37 != null && !var37.a()) {
                     var38 = var7.g(var37.v());
                     var40 = (float)((var3 - var38) / (var7.z() - var7.D()) * (double)var1.N().i());
                     if (var7.p()) {
                        var40 = -var40;
                     }

                     a(var0, var37, var1, var2, var40, var45, var19, var21, var47 + 1, var22.size());
                     var41 = a(var1, var2, var40, var45, var19, var21, var47 + 1, var22.size());
                     var13.clear();
                     var42 = new Object[]{var47, var36, var41};
                     com.aspose.cells.b.a.a.ze.a(var13, (Object)var42);
                     c(var0, var1, var13);
                  }
               }
            }
         }
      } else {
         for(var25 = 0; var25 < var22.size(); ++var25) {
            var26 = var22.size() - 1 - var25;
            if (var1.D() >= 180 && var1.D() < 270) {
               var26 = var22.size() - 1 - var26;
            }

            if (var9.p()) {
               var26 = var22.size() - 1 - var26;
            }

            zbcp var27 = (zbcp)var22.get(var26);
            var28 = var27.ai();
            zjf var29 = var27.D();

            for(int var30 = 0; var30 < var24; ++var30) {
               var31 = var30;
               if (var1.D() >= 180 && var1.D() < 270) {
                  var31 = var24 - 1 - var30;
               }

               var32 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var23.get(var31)));
               var32 = zbq.a(var16, var32, var1.S());
               int var33 = zbq.a(var16, var32, (int)var8.D(), var1.S());
               float var34 = var18 * (float)var33;
               float var35 = var1.N().e() + var34 + var20 / 2.0F;
               var36 = var31;
               if (var8.p()) {
                  var36 = var24 - 1 - var31;
               }

               var37 = var29.b(var36);
               if (var37 != null && !var37.a()) {
                  var38 = var7.g(var37.v());
                  var40 = (float)((var3 - var38) / (var7.z() - var7.D()) * (double)var1.N().i());
                  if (var7.p()) {
                     var40 = -var40;
                  }

                  a(var0, var37, var1, var2, var40, var35, var19, var21, var28 + 1, var22.size());
                  var41 = a(var1, var2, var40, var35, var19, var21, var28 + 1, var22.size());
                  var13.clear();
                  var42 = new Object[]{var28, var36, var41};
                  com.aspose.cells.b.a.a.ze.a(var13, (Object)var42);
                  c(var0, var1, var13);
               }
            }
         }
      }

   }

   static void c(zn var0, zif var1, float var2, double var3, int var5) throws Exception {
      zbcr var6 = var1.z();
      int var7 = var6.getCount();
      zbo var8 = var1.E();
      zbo var9 = var1.e();
      if (var9.k() == 2) {
         d(var0, var1, var2, var3);
      } else {
         float var10 = (float)var1.m() / 100.0F;
         float var11 = (float)var1.n() / 100.0F;
         ArrayList var12 = new ArrayList();
         double var13 = var8.n() ? zbuk.e(var8.z()) : var8.z();
         double var15 = var8.n() ? zbuk.e(var8.D()) : var8.D();
         var3 = var8.n() ? zbuk.e(var3) : var3;
         boolean var17 = false;
         boolean var18 = var9.f() || var1.u();
         int var39;
         if (var18) {
            var39 = var5;
         } else {
            var39 = var5 - 1;
            if (var39 == 0) {
               var39 = 1;
            }
         }

         float var19 = var1.N().g() / (float)var39;
         float var20 = var19 * var10 / (1.0F + var11);
         ArrayList var21 = new ArrayList();
         ArrayList var22 = var6.j();
         int var23;
         int var24;
         zbcp var25;
         int var26;
         zjf var27;
         int var28;
         int var29;
         float var30;
         int var31;
         zjd var32;
         double var33;
         float var35;
         Object[] var36;
         byte var37;
         Object[] var38;
         if (var1.D() >= 0 && var1.D() < 90 || var1.D() >= 180 && var1.D() < 270) {
            for(var23 = 0; var23 < var22.size(); ++var23) {
               var24 = var22.size() - 1 - var23;
               if (var1.D() >= 180 && var1.D() < 270) {
                  var24 = var22.size() - 1 - var24;
               }

               if (var1.I().p()) {
                  var24 = var22.size() - 1 - var24;
               }

               var25 = (zbcp)var22.get(var24);
               var26 = var25.ai();
               var27 = var25.D();

               for(var28 = 0; var28 < var5; ++var28) {
                  var29 = var28;
                  if (var1.D() >= 180 && var1.D() < 270) {
                     var29 = var5 - 1 - var28;
                  }

                  var30 = var19 * (float)var29;
                  var30 += var1.N().e();
                  if (var18) {
                     var30 += var19 / 2.0F;
                  }

                  var31 = var29;
                  if (var9.p()) {
                     var31 = var5 - 1 - var29;
                  }

                  var32 = var27.b(var31);
                  if (var32 != null && !var32.a()) {
                     var33 = var8.g(var32.v());
                     var35 = (float)((var3 - var33) / (var13 - var15) * (double)var1.N().i());
                     if (var8.p()) {
                        var35 = -var35;
                     }

                     var36 = new Object[]{var32, a(var0, var1, var2, var35, var30, var20, var26 + 1, var22.size())};
                     com.aspose.cells.b.a.a.ze.a(var21, (Object)var36);
                     var37 = 0;
                     if (var1.D() >= 90 && var1.D() < 270) {
                        var37 = 1;
                     }

                     var38 = new Object[]{var26, var31, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var36[1]))[var37]};
                     com.aspose.cells.b.a.a.ze.a(var12, (Object)var38);
                  } else {
                     com.aspose.cells.b.a.a.ze.a(var21, (Object)null);
                  }
               }

               a((zn)var0, (zif)var1, (List)var21);
               var21.clear();
               c(var0, var1, var12);
               var12.clear();
            }
         } else if (var1.D() >= 90 && var1.D() < 180 || var1.D() >= 270 && var1.D() < 360) {
            for(var23 = 0; var23 < var22.size(); ++var23) {
               var24 = var23;
               if (var1.D() >= 270 && var1.D() < 360) {
                  var24 = var22.size() - 1 - var23;
               }

               if (var1.I().p()) {
                  var24 = var22.size() - 1 - var24;
               }

               var25 = (zbcp)var22.get(var24);
               var26 = var25.ai();
               var27 = var25.D();

               for(var28 = 0; var28 < var5; ++var28) {
                  var29 = var28;
                  if (var1.D() >= 270 && var1.D() < 360) {
                     var29 = var5 - 1 - var28;
                  }

                  var30 = var19 * (float)var29;
                  var30 += var1.N().e();
                  if (var18) {
                     var30 += var19 / 2.0F;
                  }

                  var31 = var29;
                  if (var9.p()) {
                     var31 = var5 - 1 - var29;
                  }

                  var32 = var27.b(var31);
                  if (var32 != null && !var32.a()) {
                     var33 = var8.g(var32.v());
                     var35 = (float)((var3 - var33) / (var13 - var15) * (double)var1.N().i());
                     if (var8.p()) {
                        var35 = -var35;
                     }

                     var36 = new Object[]{var32, a(var0, var1, var2, var35, var30, var20, var26 + 1, var22.size())};
                     com.aspose.cells.b.a.a.ze.a(var21, (Object)var36);
                     var37 = 0;
                     if (var1.D() >= 90 && var1.D() < 270) {
                        var37 = 1;
                     }

                     var38 = new Object[]{var26, var31, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var36[1]))[var37]};
                     com.aspose.cells.b.a.a.ze.a(var12, (Object)var38);
                  }
               }

               a((zn)var0, (zif)var1, (List)var21);
               var21.clear();
               c(var0, var1, var12);
               var12.clear();
            }
         }

      }
   }

   private static void d(zn var0, zif var1, float var2, double var3) throws Exception {
      zbcr var5 = var1.z();
      int var6 = var5.getCount();
      zbo var7 = var1.E();
      zbo var8 = var1.e();
      zbo var9 = var1.I();
      float var10 = (float)var1.m() / 100.0F;
      float var11 = (float)var1.n() / 100.0F;
      ArrayList var12 = new ArrayList();
      int var13 = var8.j();
      int var14 = (int)var8.D();
      int var15 = (int)var8.z();
      boolean var16 = false;
      boolean var17 = var8.f() || var1.u();
      int var43;
      if (var17) {
         var43 = zbq.a(var13, var15, var14, var1.S()) + 1;
      } else {
         var43 = zbq.a(var13, var15, var14, var1.S());
         if (var43 == 0) {
            var43 = 1;
         }
      }

      float var18 = var1.N().g() / (float)var43;
      float var19 = var18 * var10 / (1.0F + var11);
      ArrayList var20 = new ArrayList();
      ArrayList var21 = var5.j();
      ArrayList var22 = zhz.a((List)var1.z().c(), var1.S());
      int var23 = var22.size();
      int var24;
      int var25;
      zbcp var26;
      int var27;
      zjf var28;
      int var29;
      int var30;
      int var31;
      int var32;
      float var33;
      float var34;
      int var35;
      zjd var36;
      double var37;
      float var39;
      Object[] var40;
      byte var41;
      Object[] var42;
      if (var1.D() >= 0 && var1.D() < 90 || var1.D() >= 180 && var1.D() < 270) {
         for(var24 = 0; var24 < var21.size(); ++var24) {
            var25 = var21.size() - 1 - var24;
            if (var1.D() >= 180 && var1.D() < 270) {
               var25 = var21.size() - 1 - var25;
            }

            if (var9.p()) {
               var25 = var21.size() - 1 - var25;
            }

            var26 = (zbcp)var21.get(var25);
            var27 = var26.ai();
            var28 = var26.D();

            for(var29 = 0; var29 < var23; ++var29) {
               var30 = var29;
               if (var1.D() >= 180 && var1.D() < 270) {
                  var30 = var23 - 1 - var29;
               }

               var31 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var22.get(var30)));
               var31 = zbq.a(var13, var31, var1.S());
               var32 = zbq.a(var13, var31, (int)var8.D(), var1.S());
               var33 = var18 * (float)var32;
               var34 = var1.N().e() + var33;
               if (var17) {
                  var34 += var18 / 2.0F;
               }

               var35 = var30;
               if (var8.p()) {
                  var35 = var23 - 1 - var30;
               }

               var36 = var28.b(var35);
               if (var36 != null && !var36.a()) {
                  var37 = var7.g(var36.v());
                  var39 = (float)((var3 - var37) / (var7.z() - var7.D()) * (double)var1.N().i());
                  if (var7.p()) {
                     var39 = -var39;
                  }

                  var40 = new Object[]{var36, a(var0, var1, var2, var39, var34, var19, var27 + 1, var21.size())};
                  com.aspose.cells.b.a.a.ze.a(var20, (Object)var40);
                  var41 = 0;
                  if (var1.D() >= 90 && var1.D() < 270) {
                     var41 = 1;
                  }

                  var42 = new Object[]{var27, var35, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var40[1]))[var41]};
                  com.aspose.cells.b.a.a.ze.a(var12, (Object)var42);
               } else {
                  com.aspose.cells.b.a.a.ze.a(var20, (Object)null);
               }
            }

            a((zn)var0, (zif)var1, (List)var20);
            var20.clear();
            c(var0, var1, var12);
            var12.clear();
         }
      } else if (var1.D() >= 90 && var1.D() < 180 || var1.D() >= 270 && var1.D() < 360) {
         for(var24 = 0; var24 < var21.size(); ++var24) {
            var25 = var24;
            if (var1.D() >= 270 && var1.D() < 360) {
               var25 = var21.size() - 1 - var24;
            }

            if (var9.p()) {
               var25 = var21.size() - 1 - var25;
            }

            var26 = (zbcp)var21.get(var25);
            var27 = var26.ai();
            var28 = var26.D();

            for(var29 = 0; var29 < var23; ++var29) {
               var30 = var29;
               if (var1.D() >= 270 && var1.D() < 360) {
                  var30 = var23 - 1 - var29;
               }

               var31 = com.aspose.cells.b.a.zo.a(com.aspose.cells.b.a.zr.a(var22.get(var30)));
               var31 = zbq.a(var13, var31, var1.S());
               var32 = zbq.a(var13, var31, (int)var8.D(), var1.S());
               var33 = var18 * (float)var32;
               var34 = var1.N().e() + var33;
               if (var17) {
                  var34 += var18 / 2.0F;
               }

               var35 = var30;
               if (var8.p()) {
                  var35 = var23 - 1 - var30;
               }

               var36 = var28.b(var35);
               if (var36 != null && !var36.a()) {
                  var37 = var7.g(var36.v());
                  var39 = (float)((var3 - var37) / (var7.z() - var7.D()) * (double)var1.N().i());
                  if (var7.p()) {
                     var39 = -var39;
                  }

                  var40 = new Object[]{var36, a(var0, var1, var2, var39, var34, var19, var27 + 1, var21.size())};
                  com.aspose.cells.b.a.a.ze.a(var20, (Object)var40);
                  var41 = 0;
                  if (var1.D() >= 90 && var1.D() < 270) {
                     var41 = 1;
                  }

                  var42 = new Object[]{var27, var35, ((com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var40[1]))[var41]};
                  com.aspose.cells.b.a.a.ze.a(var12, (Object)var42);
               }
            }

            a((zn)var0, (zif)var1, (List)var20);
            var20.clear();
            c(var0, var1, var12);
            var12.clear();
         }
      }

   }

   private static void a(double var0, Object[] var2, ArrayList var3, zbo var4) {
      zif var5 = var4.c();
      int var6 = (int)((double)((Float)var2[2] + (Float)var2[3]) + 0.5D);
      if (var3.size() == 0) {
         com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
      } else {
         for(int var7 = 0; var7 < var3.size(); ++var7) {
            Object[] var8 = (Object[])((Object[])var3.get(var7));
            int var9 = (int)((double)((Float)var8[2] + (Float)var8[3]) + 0.5D);
            if (var5.p() >= 0) {
               if (var6 > var9) {
                  var3.add(var7, var2);
                  break;
               }

               if (var6 == var9) {
                  if (var4.p()) {
                     if (var0 > 0.0D) {
                        var3.add(var7, var2);
                     } else {
                        var3.add(var7 + 1, var2);
                     }
                  } else if (var0 < 0.0D) {
                     var3.add(var7, var2);
                  } else {
                     var3.add(var7 + 1, var2);
                  }
                  break;
               }

               if (var7 == var3.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
                  break;
               }
            } else {
               if (var6 < var9) {
                  var3.add(var7, var2);
                  break;
               }

               if (var6 == var9) {
                  if (!var4.p()) {
                     if (var0 > 0.0D) {
                        var3.add(var7, var2);
                     } else {
                        var3.add(var7 + 1, var2);
                     }
                  } else if (var0 < 0.0D) {
                     var3.add(var7, var2);
                  } else {
                     var3.add(var7 + 1, var2);
                  }
                  break;
               }

               if (var7 == var3.size() - 1) {
                  com.aspose.cells.b.a.a.ze.a(var3, (Object)var2);
                  break;
               }
            }
         }
      }

   }

   private static com.aspose.cells.b.a.b.zo a(zif var0, float var1, float var2, float var3, float var4) {
      int var5 = var0.D() / 45;
      float var6 = 0.0F;
      switch(var5) {
      case 0:
      case 8:
         var6 = var2 / 2.0F;
         break;
      case 1:
         var6 = var2;
         var4 /= 2.0F;
         break;
      case 2:
         var6 = var2;
         var4 /= 2.0F;
         break;
      case 3:
         var6 = var2 / 2.0F;
         break;
      case 4:
         var6 = var2 / 2.0F;
         break;
      case 5:
         var6 = 0.0F;
         var4 /= 2.0F;
         break;
      case 6:
         var6 = 0.0F;
         var4 /= 2.0F;
         break;
      case 7:
         var6 = var2 / 2.0F;
      }

      float var8 = var0.N().j();
      var1 += var6;
      float var7;
      if (var1 <= var8) {
         var7 = 2.0F * (var8 - var1);
         return a(var0, var3 + var4, var7, 0.0F, 0);
      } else {
         var7 = 2.0F * (var1 - var8);
         return a(var0, var3 + var4, var7, 0.0F, 1);
      }
   }

   static com.aspose.cells.b.a.b.zo a(zif var0, float var1, float var2, float var3, float var4, float var5) {
      int var6 = var0.D() / 45;
      float var7 = 0.0F;
      byte var8 = 0;
      switch(var6) {
      case 0:
      case 8:
         var7 = var2 / 2.0F;
         break;
      case 1:
         var7 = var2;
         var3 = 0.0F;
         break;
      case 2:
         var7 = var2;
         var3 = 0.0F;
         break;
      case 3:
         var7 = var2 / 2.0F;
         var8 = 1;
         break;
      case 4:
         var7 = var2 / 2.0F;
         var8 = 2;
         break;
      case 5:
         var7 = 0.0F;
         var3 = 0.0F;
         break;
      case 6:
         var7 = 0.0F;
         var3 = 0.0F;
         break;
      case 7:
         var7 = var2 / 2.0F;
      }

      float var10 = var0.N().j();
      var1 += var7;
      float var9;
      byte var11;
      if (var1 <= var10) {
         var9 = 2.0F * (var10 - var1);
         if (var8 == 0) {
            var11 = 0;
         } else {
            var11 = 3;
         }

         return a(var0, var4 + var5 / 2.0F, var9, var3, var11);
      } else {
         var9 = 2.0F * (var1 - var10);
         if (var8 == 0) {
            var11 = 1;
         } else {
            var11 = 2;
         }

         return a(var0, var4 + var5 / 2.0F, var9, var3, var11);
      }
   }

   static void c(zn var0, zif var1, ArrayList var2) throws Exception {
      zbcr var3 = var1.z();

      for(int var4 = 0; var4 < var2.size(); ++var4) {
         Object[] var5 = (Object[])((Object[])var2.get(var4));
         int var6 = (Integer)var5[0];
         int var7 = (Integer)var5[1];
         com.aspose.cells.b.a.b.zo var8 = (com.aspose.cells.b.a.b.zo)var5[2];
         zpt var9 = var3.c(var6).D().b(var7).o();
         com.aspose.cells.b.a.b.zt var10 = zpv.a(var0, var1.e(), var3, var6, var7, (int)var1.N().g());
         float var11 = var8.d() - var10.b() / 2.0F;
         float var12 = var8.e() - var10.c() / 2.0F;
         var9.a().b = new com.aspose.cells.b.a.b.zp(zbuk.c((double)var11), zbuk.c((double)var12), zbuk.a((double)var10.b()), zbuk.a((double)var10.c()));
         var9.a().z();
         zpv.a(var0, var1.e(), var3, var6, var7, var9.a().a);
      }

   }

   private static void a(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, double var8, double[] var10) {
      zbcp var11 = var1.g().a();
      double var12 = 1.0D;
      double var14 = 1.0D;
      double var16;
      double var18;
      double[] var20;
      double[] var21;
      switch(var11.G()) {
      case 0:
         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 1:
         if (!var11.an() && !var11.ap()) {
            var12 = 0.0D;
         } else {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ah(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         }

         var10[0] = var12;
         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 2:
         if (var11.an()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            b(var11.ah(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else if (var11.ap()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ah(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else {
            var12 = (double)((float)a(var1));
            var14 = 1.0D;
         }

         var10[0] = var12;
         a(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 3:
         var10[0] = var12;
         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 4:
         if (!var11.an() && !var11.ap()) {
            var12 = 0.0D;
         } else {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ah(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         }

         var10[0] = var12;
         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
         break;
      case 5:
         if (var11.an()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            b(var11.ah(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else if (var11.ap()) {
            var16 = 0.0D;
            var18 = 0.0D;
            var20 = new double[]{var16};
            var21 = new double[]{var18};
            a(var11.ah(), var1.G(), var20, var21);
            var16 = var20[0];
            var18 = var21[0];
            if (var1.v() == 0.0D) {
               var12 = var10[0];
               var14 = var10[0];
            } else if (var1.v() > 0.0D) {
               var12 = var16 == 0.0D ? 1.0D : (var16 - var8) / var16;
               var14 = var16 == 0.0D ? 1.0D : (var16 - (var8 - var1.v())) / var16;
            } else {
               var12 = var18 == 0.0D ? 1.0D : (var18 - var8) / var18;
               var14 = var18 == 0.0D ? 1.0D : (var18 - (var8 - var1.v())) / var18;
            }
         } else {
            var12 = (double)((float)a(var1));
            var14 = 1.0D;
         }

         var10[0] = var12;
         b(var0, var1, var2, var3, var4, var5, var6, var7, (float)var12, (float)var14);
      }

   }

   static com.aspose.cells.b.a.b.zo a(zif var0, float var1, float var2, float var3, int var4) {
      com.aspose.cells.b.a.b.zo var5 = new com.aspose.cells.b.a.b.zo(var0.N().e() + var0.N().g() / 2.0F, var1);
      int var6 = var0.D() % 90;
      if (var6 >= 45) {
         var6 = 90 - var6;
      }

      int var9 = var0.D() / 45;
      float var7;
      float var8;
      switch(var9) {
      case 0:
      case 3:
      case 4:
      case 7:
      case 8:
         var7 = var2;
         var8 = var3;
         break;
      case 1:
      case 2:
      case 5:
      case 6:
      default:
         var7 = var3;
         var8 = var2;
      }

      float var10 = var8 * (float)Math.sin((double)var6 * 3.141592653589793D / 180.0D);
      float var11 = var8 * (float)Math.sin((double)var0.p() * 3.141592653589793D / 180.0D);
      com.aspose.cells.b.a.b.zo[] var12 = new com.aspose.cells.b.a.b.zo[4];
      zbuk.a(var12);
      switch(var9) {
      case 0:
      case 8:
         var12[0].a(var5.d() - (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() + var7);
         var12[2].a(var12[1].d() + var10);
         var12[3].a(var12[0].d() + var10);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() - var11);
         var12[3].b(var12[2].e());
         break;
      case 1:
         var12[0].a(var5.d() - (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() + var10);
         var12[2].a(var12[1].d() + var7);
         var12[3].a(var12[0].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e() + var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 2:
         var12[1].a(var5.d() - (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() + var10);
         var12[2].a(var12[1].d() + var7);
         var12[3].a(var12[0].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e() + var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 3:
         var12[1].a(var5.d() - (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() + var7);
         var12[2].a(var12[1].d() + var10);
         var12[3].a(var12[2].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() + var11);
         var12[3].b(var12[2].e());
         break;
      case 4:
         var12[0].a(var5.d() + (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() - var7);
         var12[2].a(var12[1].d() - var10);
         var12[3].a(var12[2].d() + var7);
         var12[0].b(var5.e() - var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() + var11);
         var12[3].b(var12[2].e());
         break;
      case 5:
         var12[0].a(var5.d() + (var7 + var10) / 2.0F);
         var12[1].a(var12[0].d() - var10);
         var12[2].a(var12[1].d() - var7);
         var12[3].a(var12[0].d() - var7);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e() - var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 6:
         var12[1].a(var5.d() + (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() - var10);
         var12[2].a(var12[1].d() - var7);
         var12[3].a(var12[0].d() - var7);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e() - var11);
         var12[2].b(var12[1].e());
         var12[3].b(var12[0].e());
         break;
      case 7:
         var12[1].a(var5.d() + (var7 + var10) / 2.0F);
         var12[0].a(var12[1].d() - var7);
         var12[2].a(var12[1].d() - var10);
         var12[3].a(var12[2].d() - var7);
         var12[0].b(var5.e() + var11 / 2.0F);
         var12[1].b(var12[0].e());
         var12[2].b(var12[1].e() - var11);
         var12[3].b(var12[2].e());
      }

      return var12[var4];
   }

   static com.aspose.cells.b.a.b.zo[] a(zn var0, zif var1, float var2, float var3, float var4, float var5, int var6, int var7) {
      float var8 = var5 * (float)var1.n() / 100.0F;
      com.aspose.cells.b.a.b.zo[] var9 = new com.aspose.cells.b.a.b.zo[2];
      zbuk.a(var9);
      float var12 = var1.N().j();
      zbo var13 = var1.I();
      float var14 = var1.N().h() / (float)var7;
      float var15 = (float)var7 / 2.0F;
      if (var13.p()) {
         var6 = var7 + 1 - var6;
      }

      float var10;
      float var11;
      if ((float)var6 <= var15 && !var13.p()) {
         var11 = ((var15 - (float)var6) * var14 + var8 / 2.0F + var5) * 2.0F;
         if (var4 <= var12) {
            var10 = 2.0F * (var12 - var4);
            var9[0] = a(var1, var2 + var3, var10, var11, 0);
            var11 -= var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 0);
         } else {
            var10 = 2.0F * (var4 - var12);
            var9[0] = a(var1, var2 + var3, var10, var11, 1);
            var11 -= var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 1);
         }
      } else {
         var11 = (((float)var6 - var15) * var14 - var8 / 2.0F - var5) * 2.0F;
         if (var4 <= var12) {
            var10 = 2.0F * (var12 - var4);
            var9[0] = a(var1, var2 + var3, var10, var11, 3);
            var11 += var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 3);
         } else {
            var10 = 2.0F * (var4 - var12);
            var9[0] = a(var1, var2 + var3, var10, var11, 2);
            var11 += var5 * 2.0F;
            var9[1] = a(var1, var2 + var3, var10, var11, 2);
         }
      }

      return var9;
   }

   private static void a(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, int var8, int var9) {
      zbcp var10 = var1.g().a();
      switch(var10.G()) {
      case 0:
         a(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 1.0F);
         break;
      case 1:
         a(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 0.0F);
      case 2:
      default:
         break;
      case 3:
         b(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 1.0F);
         break;
      case 4:
         b(var0, var1, var2, var3, var4, var5, var6, var7, var8, var9, 0.0F);
      }

   }

   private static void a(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, int var8, int var9, float var10) {
      float var11 = var7 * (float)var2.n() / 100.0F;
      com.aspose.cells.b.a.b.zo[] var12 = new com.aspose.cells.b.a.b.zo[8];
      zbuk.a(var12);
      float var15 = var2.N().j();
      zbo var16 = var2.I();
      float var17 = var5;
      float var18 = var5 + var6 * (1.0F - var10) / 2.0F;
      float var19 = var2.N().h() / (float)var9;
      float var20 = (float)var9 / 2.0F;
      if (var16.p()) {
         var8 = var9 + 1 - var8;
      }

      boolean var21 = false;
      if ((float)var8 <= var20 && !var16.p()) {
         var21 = true;
      }

      float var14 = (((float)var8 - var20) * var19 - var11 / 2.0F - var7) * 2.0F;
      byte var22;
      byte var23;
      if (var21) {
         var14 = -var14;
         var22 = 0;
         var23 = 1;
      } else {
         var22 = 3;
         var23 = 2;
      }

      byte var24 = 3;
      com.aspose.cells.b.a.b.zo var25 = com.aspose.cells.b.a.b.zo.a();

      for(int var26 = 0; var26 < 2; ++var26) {
         float var13;
         if (var17 <= var15) {
            var13 = 2.0F * (var15 - var17);
            var12[var26] = a(var2, var3, var13, var14, var22);
            if (var21) {
               var14 -= var7 * 2.0F;
            } else {
               var14 += var7 * 2.0F;
            }

            var12[var26 + var24] = a(var2, var3, var13, var14, var22);
         } else {
            var13 = 2.0F * (var17 - var15);
            var12[var26] = a(var2, var3, var13, var14, var23);
            if (var21) {
               var14 -= var7 * 2.0F;
            } else {
               var14 += var7 * 2.0F;
            }

            var12[var26 + var24] = a(var2, var3, var13, var14, var23);
         }

         var14 = (((float)var8 - var20) * var19 - var11 / 2.0F - var7) * 2.0F;
         if (var21) {
            var14 = -var14;
         }

         if (var18 <= var15) {
            var13 = 2.0F * (var15 - var18);
            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var22);
            var12[var26 + 4].a(var25.d());
            var12[var26 + 4].b(var25.e() + var4);
            if (var10 == 1.0F) {
               if (var21) {
                  var14 -= var7 * 2.0F;
               } else {
                  var14 += var7 * 2.0F;
               }
            }

            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var22);
            var12[var26 + var24 + 4].a(var25.d());
            var12[var26 + var24 + 4].b(var25.e() + var4);
         } else {
            var13 = 2.0F * (var18 - var15);
            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var23);
            var12[var26 + 4].a(var25.d());
            var12[var26 + 4].b(var25.e() + var4);
            if (var10 == 1.0F) {
               if (var21) {
                  var14 -= var7 * 2.0F;
               } else {
                  var14 += var7 * 2.0F;
               }
            }

            var25 = a(var2, var3, var13, a(var14, var21, var7, var10), var23);
            var12[var26 + var24 + 4].a(var25.d());
            var12[var26 + var24 + 4].b(var25.e() + var4);
         }

         var24 = 1;
         var17 += var6;
         var18 += var6 * var10;
         var14 = (((float)var8 - var20) * var19 - var11 / 2.0F - var7) * 2.0F;
         if (var21) {
            var14 = -var14;
         }
      }

      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[0].d(), var12[0].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[1].d(), var12[1].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[2].d(), var12[2].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var12[3].d(), var12[3].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[4].d(), var12[4].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[5].d(), var12[5].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[6].d(), var12[6].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var12[7].d(), var12[7].e())));
      a(var0, var2, var1, var12, var4);
   }

   private static void b(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, int var8, int var9, float var10) {
      float var12 = var2.N().j();
      HashMap var13 = new HashMap();
      HashMap var14 = new HashMap();
      float var15 = var5 + var6 / 2.0F;
      float var16 = var7 * (float)var2.n() / 100.0F;
      zbo var18 = var2.I();
      float var19 = var2.N().h() / (float)var9;
      float var20 = (float)var9 / 2.0F;
      if (var18.p()) {
         var8 = var9 + 1 - var8;
      }

      boolean var21 = false;
      if ((float)var8 <= var20 && !var18.p()) {
         var21 = true;
      }

      float var17 = (((float)var8 - var20) * var19 - var16 / 2.0F - var7 / 2.0F) * 2.0F;
      byte var22;
      byte var23;
      if (var21) {
         var17 = -var17;
         var22 = 0;
         var23 = 1;
      } else {
         var22 = 3;
         var23 = 2;
      }

      int var24;
      for(var24 = 0; var24 <= 180; ++var24) {
         double var25 = (double)var24 * 3.141592653589793D / 180.0D;
         float var27 = (float)((double)var7 * Math.sin(var25));
         float var28 = (float)((double)var15 + (double)(var6 / 2.0F) * Math.cos(var25));
         float var11;
         if (var28 <= var12) {
            var11 = 2.0F * (var12 - var28);
            if (!var13.containsKey(360 - var24)) {
               var13.put(360 - var24, a(var2, var3, var11, a(360 - var24, var21, var17, var27), var22));
            }

            if (!var13.containsKey(var24)) {
               var13.put(var24, a(var2, var3, var11, a(var24, var21, var17, var27), var22));
            }
         } else {
            var11 = 2.0F * (var28 - var12);
            if (!var13.containsKey(360 - var24)) {
               var13.put(360 - var24, a(var2, var3, var11, a(360 - var24, var21, var17, var27), var23));
            }

            if (!var13.containsKey(var24)) {
               var13.put(var24, a(var2, var3, var11, a(var24, var21, var17, var27), var23));
            }
         }

         var28 = (float)((double)var15 + (double)(var6 / 2.0F * var10) * Math.cos(var25));
         var27 = (float)((double)(var7 * var10) * Math.sin(var25));
         com.aspose.cells.b.a.b.zo var29;
         if (var28 <= var12) {
            var11 = 2.0F * (var12 - var28);
            if (!var14.containsKey(360 - var24)) {
               var29 = a(var2, var3, var11, a(360 - var24, var21, var17, var27), var22);
               var29.b(var29.e() + var4);
               var14.put(360 - var24, var29);
            }

            if (!var14.containsKey(var24)) {
               var29 = a(var2, var3, var11, a(var24, var21, var17, var27), var22);
               var29.b(var29.e() + var4);
               var14.put(var24, var29);
            }
         } else {
            var11 = 2.0F * (var28 - var12);
            if (!var14.containsKey(360 - var24)) {
               var29 = a(var2, var3, var11, a(360 - var24, var21, var17, var27), var23);
               var29.b(var29.e() + var4);
               var14.put(360 - var24, var29);
            }

            if (!var14.containsKey(var24)) {
               var29 = a(var2, var3, var11, a(var24, var21, var17, var27), var23);
               var29.b(var29.e() + var4);
               var14.put(var24, var29);
            }
         }
      }

      for(var24 = 0; var24 < 360; ++var24) {
         com.aspose.cells.b.a.a.ze.a(var1.c, var13.get(var24));
         com.aspose.cells.b.a.a.ze.a(var1.b, var14.get(var24));
      }

      a(var0, var1, var13, var14, var4, 175, 365);
      a(var0, var1, var13, var14, var4, 176, 364);
      a(var0, var1, var13, var14, var4, 177, 363);
      a(var0, var1, var13, var14, var4, 178, 362);
      a(var0, var1, var13, var14, var4, 179, 361);
      a(var0, var1, var13, var14, var4, 180, 360);
   }

   private static float a(int var0, boolean var1, float var2, float var3) {
      if (var1) {
         return var0 <= 180 ? var2 - var3 : var2 + var3;
      } else {
         return var0 <= 180 ? var2 + var3 : var2 - var3;
      }
   }

   private static float a(float var0, boolean var1, float var2, float var3) {
      if (var1) {
         var0 -= var2 * (1.0F - var3);
      } else {
         var0 += var2 * (1.0F - var3);
      }

      return var0;
   }

   private static void a(zn var0, zif var1, List var2) {
      if (var2.size() > 1) {
         com.aspose.cells.b.a.b.zo[] var3 = null;

         int var4;
         for(var4 = 0; var4 < var2.size(); ++var4) {
            if (var2.get(var4) != null) {
               Object[] var5 = (Object[])((Object[])var2.get(var4));
               var3 = (com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var5[1]);
               ++var4;
               break;
            }
         }

         for(int var7 = var4; var7 < var2.size(); ++var7) {
            if (var2.get(var7) != null) {
               Object[] var8 = (Object[])((Object[])var2.get(var7));
               zjd var9 = (zjd)var8[0];
               com.aspose.cells.b.a.b.zo[] var6 = (com.aspose.cells.b.a.b.zo[])((com.aspose.cells.b.a.b.zo[])var8[1]);
               a(var0, var1, var9, var3, var6);
               var3 = var6;
            } else {
               var3 = null;
            }
         }
      }

   }

   private static void a(zn var0, zif var1, zjd var2, com.aspose.cells.b.a.b.zo[] var3, com.aspose.cells.b.a.b.zo[] var4) {
      if (var3 != null && var4 != null && var2 != null) {
         zas var5 = var2.i();
         com.aspose.cells.b.a.b.a.ze var6 = new com.aspose.cells.b.a.b.a.ze();
         var6.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var4[0], var4[1], var3[1]});
         com.aspose.cells.b.a.b.zc var7 = null;
         com.aspose.cells.b.a.b.zm var8 = zama.a(var2.k());

         try {
            if (var1.D() != 0 && var1.D() != 360 && var1.D() != 180) {
               if (var1.D() != 90 && var1.D() != 270) {
                  if (var3[1].d() != var4[1].d() && var3[1].e() != var4[1].e()) {
                     float var9 = 0.0F;
                     float var10 = (var9 - var3[1].e() - (var9 - var4[1].e())) / (var3[1].d() - var4[1].d());
                     float var11 = var9 - var4[1].e() - var10 * var4[1].d();
                     float var12 = var9 - var4[0].e();
                     float var13 = var10 * var4[0].d() + var11;
                     if (var1.D() > 0 && var1.D() < 90 || var1.D() > 270 && var1.D() < 360) {
                        if (var12 > var13) {
                           var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6), 0.6666667F);
                        } else {
                           var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6));
                        }
                     } else if (var1.D() > 90 && var1.D() < 270) {
                        if (var12 < var13) {
                           var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6), 0.6666667F);
                        } else {
                           var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6));
                        }
                     }
                  }
               } else if (var4[0].e() > var3[0].e()) {
                  var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6));
               } else {
                  var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6), 0.6666667F);
               }
            } else if (var4[1].e() > var4[0].e()) {
               if (var1.D() != 0 && var1.D() != 360) {
                  var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6));
               } else {
                  var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6), 0.6666667F);
               }
            } else if (var1.D() != 0 && var1.D() != 360) {
               var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6), 0.6666667F);
            } else {
               var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6));
            }

            if (var7 == null) {
               var7 = zax.a(var5, com.aspose.cells.a.c.zn.a(var6));
            }

            var0.a(var7, var6);
            var0.a(var8, var3[0], var4[0]);
            var0.a(var8, var4[0], var4[1]);
            var0.a(var8, var4[1], var3[1]);
            var0.a(var8, var3[1], var3[0]);
            if (var7 != null) {
               var7.h();
            }
         } finally {
            if (var8 != null) {
               var8.r();
            }

         }

      }
   }

   private static com.aspose.cells.b.a.b.zo a(zif var0, float var1, float var2, float var3, float var4, float var5, int var6, int var7) {
      int var8 = var0.D() / 45;
      float var9 = 0.0F;
      float var10 = 0.0F;
      switch(var8) {
      case 0:
      case 8:
         var9 = var4 / 2.0F;
         break;
      case 1:
         var9 = var4;
         var10 = var5 / 2.0F;
         break;
      case 2:
         var9 = var4;
         var10 = var5 / 2.0F;
         break;
      case 3:
         var9 = var4 / 2.0F;
         var10 = var5;
         break;
      case 4:
         var9 = var4 / 2.0F;
         var10 = var5;
         break;
      case 5:
         var9 = 0.0F;
         var10 = var5 / 2.0F;
         break;
      case 6:
         var9 = 0.0F;
         var10 = var5 / 2.0F;
         break;
      case 7:
         var9 = var4 / 2.0F;
      }

      float var11 = var0.N().j();
      var3 += var9;
      var2 /= 2.0F;
      zbo var15 = var0.I();
      float var16 = var5 * (float)var0.n() / 100.0F;
      float var17 = var0.N().h() / (float)var7;
      float var18 = (float)var7 / 2.0F;
      if (var15.p()) {
         var6 = var7 + 1 - var6;
      }

      com.aspose.cells.b.a.b.zo var12;
      float var13;
      float var14;
      if ((float)var6 <= var18 && !var15.p()) {
         var14 = ((var18 - (float)var6) * var17 + var16 / 2.0F + var5 - var10) * 2.0F;
         if (var3 <= var11) {
            var13 = 2.0F * (var11 - var3);
            var12 = a(var0, var1 + var2, var13, var14, 0);
         } else {
            var13 = 2.0F * (var3 - var11);
            var12 = a(var0, var1 + var2, var13, var14, 1);
         }
      } else {
         var14 = (((float)var6 - var18) * var17 - var16 / 2.0F - var5 + var10) * 2.0F;
         if (var3 <= var11) {
            var13 = 2.0F * (var11 - var3);
            var12 = a(var0, var1 + var2, var13, var14, 3);
         } else {
            var13 = 2.0F * (var3 - var11);
            var12 = a(var0, var1 + var2, var13, var14, 2);
         }
      }

      return var12;
   }

   static double a(zjd var0) {
      double var1 = 0.0D;
      double var3 = 0.0D;
      zbo var5 = var0.h().E();
      double var6 = var5.U();
      zbcr var8 = var0.h().z();
      int var9 = var8.h();

      for(int var10 = 0; var10 < var0.g().getCount(); ++var10) {
         for(int var11 = 0; var11 < var8.getCount(); ++var11) {
            zjd var12 = var8.c(var11).D().b(var10);
            if (var12 != null) {
               double var13 = var12.v();
               if (var13 > var6 && var1 < var13 - var6) {
                  var1 = var13 - var6;
               }

               if (var13 < var6 && var3 < var6 - var13) {
                  var3 = var6 - var13;
               }
            }
         }
      }

      double var15 = var5.g(var0.v());
      if (var0.v() >= var6) {
         return var1 == 0.0D ? 1.0D : (var1 - (var15 - var6)) / var1;
      } else {
         return var3 == 0.0D ? 1.0D : (var3 - (var6 - var15)) / var3;
      }
   }

   static void a(zbcr var0, int var1, double[] var2, double[] var3) {
      var2[0] = 0.0D;
      var3[0] = 0.0D;

      for(int var4 = 0; var4 < var0.getCount(); ++var4) {
         zbcp var5 = var0.c(var4);
         double var6 = var5.D().a(var1).v();
         if (var6 > 0.0D) {
            var2[0] += var6;
         }

         if (var6 < 0.0D) {
            var3[0] += var6;
         }
      }

   }

   static void b(zbcr var0, int var1, double[] var2, double[] var3) {
      var2[0] = 0.0D;
      var3[0] = 0.0D;
      int var4 = var0.h();

      for(int var5 = 0; var5 < var4; ++var5) {
         double var6 = 0.0D;
         double var8 = 0.0D;
         double[] var10 = new double[]{var6};
         double[] var11 = new double[]{var8};
         a(var0, var5, var10, var11);
         var6 = var10[0];
         var8 = var11[0];
         if (var6 > var2[0]) {
            var2[0] = var6;
         }

         if (var8 < var3[0]) {
            var3[0] = var8;
         }
      }

   }

   private static void a(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, float var8, float var9) {
      com.aspose.cells.b.a.b.zo[] var10 = new com.aspose.cells.b.a.b.zo[8];
      zbuk.a(var10);
      float var12 = var2.N().j();
      byte var13 = 3;
      com.aspose.cells.b.a.b.zo var14 = com.aspose.cells.b.a.b.zo.a();
      float var15 = var3 + var4 * (1.0F - var8) / 2.0F;
      float var16 = var3 + var4 * (1.0F - var9) / 2.0F;

      for(int var17 = 0; var17 < 2; ++var17) {
         float var11;
         if (var16 <= var12) {
            var11 = 2.0F * (var12 - var16);
            var10[var17] = a(var2, var6, var11, var5 * var9, 0);
            var10[var17 + var13] = a(var2, var6, var11, var5 * var9, 3);
         } else {
            var11 = 2.0F * (var16 - var12);
            var10[var17] = a(var2, var6, var11, var5 * var9, 1);
            var10[var17 + var13] = a(var2, var6, var11, var5 * var9, 2);
         }

         if (var15 <= var12) {
            var11 = 2.0F * (var12 - var15);
            var14 = a(var2, var6, var11, var5 * var8, 0);
            var10[var17 + 4].a(var14.d());
            var10[var17 + 4].b(var14.e() + var7);
            var14 = a(var2, var6, var11, var5 * var8, 3);
            var10[var17 + var13 + 4].a(var14.d());
            var10[var17 + var13 + 4].b(var14.e() + var7);
         } else {
            var11 = 2.0F * (var15 - var12);
            var14 = a(var2, var6, var11, var5 * var8, 1);
            var10[var17 + 4].a(var14.d());
            var10[var17 + 4].b(var14.e() + var7);
            var14 = a(var2, var6, var11, var5 * var8, 2);
            var10[var17 + var13 + 4].a(var14.d());
            var10[var17 + var13 + 4].b(var14.e() + var7);
         }

         var13 = 1;
         var16 += var4 * var9;
         var15 += var4 * var8;
      }

      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var10[0].d(), var10[0].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var10[1].d(), var10[1].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var10[2].d(), var10[2].e())));
      com.aspose.cells.b.a.a.ze.a(var1.b, (Object)(new com.aspose.cells.b.a.b.zo(var10[3].d(), var10[3].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var10[4].d(), var10[4].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var10[5].d(), var10[5].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var10[6].d(), var10[6].e())));
      com.aspose.cells.b.a.a.ze.a(var1.c, (Object)(new com.aspose.cells.b.a.b.zo(var10[7].d(), var10[7].e())));
      a(var0, var2, var1, var10, var7);
   }

   private static void a(zn var0, zif var1, zjd var2, com.aspose.cells.b.a.b.zo[] var3, float var4) {
      zas var5 = var2.i();
      com.aspose.cells.b.a.b.zm var6 = zama.a(var2.k());

      try {
         var0.a(var6, var3[0], var3[1]);
         var0.a(var6, var3[1], var3[2]);
         var0.a(var6, var3[2], var3[3]);
         var0.a(var6, var3[0], var3[3]);
         if (var4 != 0.0F) {
            var0.a(var6, var3[4], var3[5]);
            var0.a(var6, var3[5], var3[6]);
            var0.a(var6, var3[6], var3[7]);
            var0.a(var6, var3[4], var3[7]);
            var0.a(var6, var3[0], var3[4]);
            var0.a(var6, var3[1], var3[5]);
            var0.a(var6, var3[2], var3[6]);
            var0.a(var6, var3[3], var3[7]);
         }

         com.aspose.cells.b.a.b.a.ze var7;
         com.aspose.cells.b.a.b.zc var8;
         if (var4 != 0.0F) {
            com.aspose.cells.b.a.b.zm var9;
            com.aspose.cells.b.a.b.zc var10;
            com.aspose.cells.b.a.b.a.ze var909;
            if (var1.D() > 45 && var1.D() != 360) {
               if (var1.D() > 45 && var1.D() <= 90) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

                  try {
                     if (var6.c().getA() == 0) {
                        var9 = new com.aspose.cells.b.a.b.zm(var8);

                        try {
                           var0.b(var9, var3[1].d(), var3[1].e(), var3[5].d(), var3[5].e());
                        } finally {
                           if (var9 != null) {
                              var9.r();
                           }

                        }
                     }

                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var909 = new com.aspose.cells.b.a.b.a.ze();
                  var909.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
                  var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

                  try {
                     var0.a(var10, var909);
                  } finally {
                     if (var10 != null) {
                        var10.f();
                     }

                  }

                  if (var6.c().getA() != 0) {
                     var0.a(var6, var7);
                     var0.a(var6, var909);
                  }
               } else if (var1.D() > 90 && var1.D() <= 135) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

                  try {
                     if (var6.c().getA() == 0) {
                        var9 = new com.aspose.cells.b.a.b.zm(var8);

                        try {
                           var0.b(var9, var3[2].d(), var3[2].e(), var3[6].d(), var3[6].e());
                        } finally {
                           if (var9 != null) {
                              var9.r();
                           }

                        }
                     }

                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var909 = new com.aspose.cells.b.a.b.a.ze();
                  var909.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
                  var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

                  try {
                     var0.a(var10, var909);
                  } finally {
                     if (var10 != null) {
                        var10.f();
                     }

                  }

                  if (var6.c().getA() != 0) {
                     var0.a(var6, var7);
                     var0.a(var6, var909);
                  }
               } else if (var1.D() > 135 && var1.D() <= 180) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

                  try {
                     if (var6.c().getA() == 0) {
                        var9 = new com.aspose.cells.b.a.b.zm(var8);

                        try {
                           var0.b(var9, var3[2].d(), var3[2].e(), var3[6].d(), var3[6].e());
                        } finally {
                           if (var9 != null) {
                              var9.r();
                           }

                        }
                     }

                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var909 = new com.aspose.cells.b.a.b.a.ze();
                  var909.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
                  var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

                  try {
                     var0.a(var10, var909);
                  } finally {
                     if (var10 != null) {
                        var10.f();
                     }

                  }

                  if (var6.c().getA() != 0) {
                     var0.a(var6, var7);
                     var0.a(var6, var909);
                  }
               } else if (var1.D() > 180 && var1.D() <= 225) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

                  try {
                     if (var6.c().getA() == 0) {
                        var9 = new com.aspose.cells.b.a.b.zm(var8);

                        try {
                           var0.b(var9, var3[3].d(), var3[3].e(), var3[7].d(), var3[7].e());
                        } finally {
                           if (var9 != null) {
                              var9.r();
                           }

                        }
                     }

                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var909 = new com.aspose.cells.b.a.b.a.ze();
                  var909.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
                  var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

                  try {
                     var0.a(var10, var909);
                  } finally {
                     if (var10 != null) {
                        var10.f();
                     }

                  }

                  if (var6.c().getA() != 0) {
                     var0.a(var6, var7);
                     var0.a(var6, var909);
                  }
               } else if (var1.D() > 225 && var1.D() <= 270) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

                  try {
                     if (var6.c().getA() == 0) {
                        var9 = new com.aspose.cells.b.a.b.zm(var8);

                        try {
                           var0.b(var9, var3[3].d(), var3[3].e(), var3[7].d(), var3[7].e());
                        } finally {
                           if (var9 != null) {
                              var9.r();
                           }

                        }
                     }

                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var909 = new com.aspose.cells.b.a.b.a.ze();
                  var909.b(new com.aspose.cells.b.a.b.zo[]{var3[2], var3[3], var3[7], var3[6]});
                  var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

                  try {
                     var0.a(var10, var909);
                  } finally {
                     if (var10 != null) {
                        var10.f();
                     }

                  }

                  if (var6.c().getA() != 0) {
                     var0.a(var6, var7);
                     var0.a(var6, var909);
                  }
               } else if (var1.D() > 270 && var1.D() <= 315) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

                  try {
                     if (var6.c().getA() == 0) {
                        var9 = new com.aspose.cells.b.a.b.zm(var8);

                        try {
                           var0.b(var9, var3[0].d(), var3[0].e(), var3[4].d(), var3[4].e());
                        } finally {
                           if (var9 != null) {
                              var9.r();
                           }

                        }
                     }

                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var909 = new com.aspose.cells.b.a.b.a.ze();
                  var909.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
                  var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

                  try {
                     var0.a(var10, var909);
                  } finally {
                     if (var10 != null) {
                        var10.f();
                     }

                  }

                  if (var6.c().getA() != 0) {
                     var0.a(var6, var7);
                     var0.a(var6, var909);
                  }
               } else if (var1.D() > 315 && var1.D() < 360) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

                  try {
                     if (var6.c().getA() == 0) {
                        var9 = new com.aspose.cells.b.a.b.zm(var8);

                        try {
                           var0.b(var9, var3[0].d(), var3[0].e(), var3[4].d(), var3[4].e());
                        } finally {
                           if (var9 != null) {
                              var9.r();
                           }

                        }
                     }

                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var909 = new com.aspose.cells.b.a.b.a.ze();
                  var909.b(new com.aspose.cells.b.a.b.zo[]{var3[3], var3[0], var3[4], var3[7]});
                  var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

                  try {
                     var0.a(var10, var909);
                  } finally {
                     if (var10 != null) {
                        var10.f();
                     }

                  }

                  if (var6.c().getA() != 0) {
                     var0.a(var6, var7);
                     var0.a(var6, var909);
                  }
               }
            } else {
               var7 = new com.aspose.cells.b.a.b.a.ze();
               var7.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[5], var3[4]});
               var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7));

               try {
                  if (var6.c().getA() == 0) {
                     var9 = new com.aspose.cells.b.a.b.zm(var8);

                     try {
                        var0.b(var9, var3[1].d(), var3[1].e(), var3[5].d(), var3[5].e());
                     } finally {
                        if (var9 != null) {
                           var9.r();
                        }

                     }
                  }

                  var0.a(var8, var7);
               } finally {
                  if (var8 != null) {
                     var8.f();
                  }

               }

               var909 = new com.aspose.cells.b.a.b.a.ze();
               var909.b(new com.aspose.cells.b.a.b.zo[]{var3[1], var3[2], var3[6], var3[5]});
               var10 = zax.a(var5, com.aspose.cells.a.c.zn.a(var909), 0.5F);

               try {
                  var0.a(var10, var909);
               } finally {
                  if (var10 != null) {
                     var10.f();
                  }

               }

               if (var6.c().getA() != 0) {
                  var0.a(var6, var7);
                  var0.a(var6, var909);
               }
            }

            if (var1.p() > 0) {
               if (var4 <= 0.0F) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[4], var3[5], var3[6], var3[7]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7), 0.6666667F);

                  try {
                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var0.a(var6, var7);
               } else {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[2], var3[3]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7), 0.0F);

                  try {
                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var0.a(var6, var7);
               }
            } else if (var1.p() < 0) {
               if (var4 <= 0.0F) {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[2], var3[3]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7), 0.0F);

                  try {
                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var0.a(var6, var7);
               } else {
                  var7 = new com.aspose.cells.b.a.b.a.ze();
                  var7.b(new com.aspose.cells.b.a.b.zo[]{var3[4], var3[5], var3[6], var3[7]});
                  var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7), 0.6666667F);

                  try {
                     var0.a(var8, var7);
                  } finally {
                     if (var8 != null) {
                        var8.f();
                     }

                  }

                  var0.a(var6, var7);
               }
            }
         } else {
            var7 = new com.aspose.cells.b.a.b.a.ze();
            var7.b(new com.aspose.cells.b.a.b.zo[]{var3[0], var3[1], var3[2], var3[3]});
            if (var1.p() > 0) {
               var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7), 0.6666667F);
            } else {
               var8 = zax.a(var5, com.aspose.cells.a.c.zn.a(var7), 0.0F);
            }

            var0.a(var8, var7);
            if (var8 != null) {
               var8.h();
            }

            var0.a(var6, var7);
         }
      } finally {
         if (var6 != null) {
            var6.r();
         }

      }

   }

   private static void b(zn var0, zjd var1, zif var2, float var3, float var4, float var5, float var6, float var7, float var8, float var9) {
      float var11 = var2.N().j();
      zbcp var12 = var1.g().a();
      HashMap var13 = new HashMap();
      HashMap var14 = new HashMap();
      float var15 = var3 + var4 / 2.0F;

      int var16;
      for(var16 = 0; var16 <= 180; ++var16) {
         double var17 = (double)var16 * 3.141592653589793D / 180.0D;
         float var19 = (float)((double)var5 * Math.sin(var17));
         float var20 = (float)((double)var15 + (double)(var4 * var9 / 2.0F) * Math.cos(var17));
         float var10;
         if (var20 <= var11) {
            var10 = 2.0F * (var11 - var20);
            if (!var13.containsKey(360 - var16)) {
               var13.put(360 - var16, a(var2, var6, var10, var19 * var9, 0));
            }

            if (!var13.containsKey(var16)) {
               var13.put(var16, a(var2, var6, var10, var19 * var9, 3));
            }
         } else {
            var10 = 2.0F * (var20 - var11);
            if (!var13.containsKey(360 - var16)) {
               var13.put(360 - var16, a(var2, var6, var10, var19 * var9, 1));
            }

            if (!var13.containsKey(var16)) {
               var13.put(var16, a(var2, var6, var10, var19 * var9, 2));
            }
         }

         var20 = (float)((double)var15 + (double)(var4 * var8 / 2.0F) * Math.cos(var17));
         com.aspose.cells.b.a.b.zo var21;
         if (var20 <= var11) {
            var10 = 2.0F * (var11 - var20);
            if (!var14.containsKey(360 - var16)) {
               var21 = a(var2, var6, var10, var19 * var8, 0);
               var21.b(var21.e() + var7);
               var14.put(360 - var16, var21);
            }

            if (!var14.containsKey(var16)) {
               var21 = a(var2, var6, var10, var19 * var8, 3);
               var21.b(var21.e() + var7);
               var14.put(var16, var21);
            }
         } else {
            var10 = 2.0F * (var20 - var11);
            if (!var14.containsKey(360 - var16)) {
               var21 = a(var2, var6, var10, var19 * var8, 1);
               var21.b(var21.e() + var7);
               var14.put(360 - var16, var21);
            }

            if (!var14.containsKey(var16)) {
               var21 = a(var2, var6, var10, var19 * var8, 2);
               var21.b(var21.e() + var7);
               var14.put(var16, var21);
            }
         }
      }

      for(var16 = 0; var16 < 360; ++var16) {
         com.aspose.cells.b.a.a.ze.a(var1.c, var13.get(var16));
         com.aspose.cells.b.a.a.ze.a(var1.b, var14.get(var16));
      }

      a(var0, var1, var13, var14, var7, 175, 365);
      a(var0, var1, var13, var14, var7, 176, 364);
      a(var0, var1, var13, var14, var7, 177, 363);
      a(var0, var1, var13, var14, var7, 178, 362);
      a(var0, var1, var13, var14, var7, 179, 361);
      a(var0, var1, var13, var14, var7, 180, 360);
   }

   private static void a(zn var0, zjd var1, HashMap var2, HashMap var3, float var4, int var5, int var6) {
      zbcp var7 = var1.g().a();
      zif var8 = var1.h();
      zas var9 = var1.i();
      int var10 = var8.D();
      com.aspose.cells.b.a.b.zo var11 = null;
      com.aspose.cells.b.a.b.zo var12 = null;
      byte var13 = 0;
      byte var14 = 0;
      com.aspose.cells.b.a.b.zo[] var15 = new com.aspose.cells.b.a.b.zo[]{var11};
      com.aspose.cells.b.a.b.zo[] var16 = new com.aspose.cells.b.a.b.zo[]{var12};
      int[] var17 = new int[]{var13};
      int[] var18 = new int[]{var14};
      a(var2, var15, var16, var17, var18);
      var11 = var15[0];
      var12 = var16[0];
      int var122 = var17[0];
      int var123 = var18[0];
      com.aspose.cells.b.a.b.zo var19 = null;
      com.aspose.cells.b.a.b.zo var20 = null;
      byte var21 = 0;
      byte var22 = 0;
      com.aspose.cells.b.a.b.zo[] var23 = new com.aspose.cells.b.a.b.zo[]{var19};
      com.aspose.cells.b.a.b.zo[] var24 = new com.aspose.cells.b.a.b.zo[]{var20};
      int[] var25 = new int[]{var21};
      int[] var26 = new int[]{var22};
      a(var3, var23, var24, var25, var26);
      var19 = var23[0];
      var20 = var24[0];
      int var124 = var25[0];
      int var125 = var26[0];
      if (var4 != 0.0F) {
         float var27 = 0.5F;
         float var28 = 7.5F;

         for(float var29 = (float)(var5 + var10); var29 <= (float)(var6 + var10); var29 += var28) {
            int var30 = (int)(var29 % 360.0F);
            com.aspose.cells.b.a.b.zo var31 = (com.aspose.cells.b.a.b.zo)var2.get(var30);
            com.aspose.cells.b.a.b.zo var32 = (com.aspose.cells.b.a.b.zo)var3.get(var30);
            if (var29 == (float)(var5 + var10)) {
               var31 = var12;
               var32 = var20;
            }

            float var33 = var28;
            if (var29 - (float)var5 == 45.0F && var10 <= 30 || var29 - (float)var5 == 135.0F && var10 > 30 || var29 - (float)var5 == 90.0F || var29 - (float)var5 == 180.0F || var29 - (float)var5 == 225.0F && var10 > 120 || var29 - (float)var5 == 270.0F || var29 - (float)var5 == 315.0F && var10 > 210 || var29 - (float)var5 == 360.0F || var29 - (float)var5 == 405.0F && var10 > 300 || var29 - (float)var5 == 450.0F) {
               var33 = 2.0F * var28;
            }

            if (var29 == (float)(var5 + var10)) {
               var33 = var28 - (float)var10 % var28;
            }

            int var34 = var29 + var33 > (float)(var6 + var10) ? (var6 + var10) % 360 : (int)((var29 + var33) % 360.0F);
            com.aspose.cells.b.a.b.zo var35 = (com.aspose.cells.b.a.b.zo)var2.get(var34);
            com.aspose.cells.b.a.b.zo var36 = (com.aspose.cells.b.a.b.zo)var3.get(var34);
            if (var29 + var33 >= (float)(var6 + var10)) {
               var35 = var11;
               var36 = var19;
            }

            com.aspose.cells.b.a.b.a.ze var37 = new com.aspose.cells.b.a.b.a.ze();
            com.aspose.cells.b.a.b.zo[] var38 = new com.aspose.cells.b.a.b.zo[(int)var33 + 1];
            zbuk.a(var38);
            int var39 = 0;

            for(int var40 = (int)var29; var40 <= (int)var29 + (int)var33; ++var40) {
               var38[var39] = (com.aspose.cells.b.a.b.zo)var2.get(var40 % 360);
               ++var39;
            }

            var37.a(var31, var35);
            var37.a(var35, var36);
            com.aspose.cells.b.a.b.zo[] var133 = new com.aspose.cells.b.a.b.zo[(int)var33 + 1];
            zbuk.a(var133);
            var39 = 0;

            for(int var41 = (int)var29 + (int)var33; var41 >= (int)var29; --var41) {
               var133[var39] = (com.aspose.cells.b.a.b.zo)var3.get(var41 % 360);
               ++var39;
            }

            var37.a(var36, var32);
            var37.a(var32, var31);
            if (var10 >= 0 && var10 <= 30) {
               if (var29 - (float)var5 < 45.0F) {
                  var27 = 0.75F + 0.5F * ((var29 - (float)var5) / 90.0F);
               } else {
                  var27 = 1.125F - 0.5F * ((var29 - (float)var5) / 180.0F);
               }
            } else if (var10 > 30 && var10 <= 120) {
               if (var29 - (float)var5 < 135.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5) / 180.0F);
               }
            } else if (var10 > 120 && var10 <= 210) {
               if (var29 - (float)var5 < 225.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5 - 90.0F) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5 - 90.0F) / 180.0F);
               }
            } else if (var10 > 210 && var10 <= 300) {
               if (var29 - (float)var5 < 315.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5 - 180.0F) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5 - 180.0F) / 180.0F);
               }
            } else if (var10 > 300 && var10 <= 360) {
               if (var29 - (float)var5 < 405.0F) {
                  var27 = 0.625F + 0.5F * ((var29 - (float)var5 - 270.0F) / 180.0F);
               } else {
                  var27 = 1.375F - 0.5F * ((var29 - (float)var5 - 270.0F) / 180.0F);
               }
            }

            if (var27 == 1.0F) {
               var27 -= 0.011111111F;
            }

            com.aspose.cells.b.a.b.zc var134 = zax.a(var9, com.aspose.cells.a.c.zn.a(var37), var27);

            try {
               var0.a(var134, var37);
            } finally {
               if (var134 != null) {
                  var134.f();
               }

            }

            var29 += var33 - var28;
         }
      }

      com.aspose.cells.b.a.b.zm var129 = zama.a(var1.k());

      try {
         com.aspose.cells.b.a.b.a.ze var126 = new com.aspose.cells.b.a.b.a.ze();
         com.aspose.cells.b.a.b.a.ze var127 = new com.aspose.cells.b.a.b.a.ze();
         com.aspose.cells.b.a.b.zo[] var128 = new com.aspose.cells.b.a.b.zo[var2.size()];
         com.aspose.cells.b.a.b.zo[] var130 = new com.aspose.cells.b.a.b.zo[var2.size()];
         zbuk.a(var128);
         zbuk.a(var130);

         for(int var131 = 0; var131 <= 360; ++var131) {
            var128[var131] = (com.aspose.cells.b.a.b.zo)var2.get(var131);
            var130[var131] = (com.aspose.cells.b.a.b.zo)var3.get(var131);
         }

         var126.c(var128);
         var127.c(var130);
         com.aspose.cells.b.a.b.zc var132;
         if (var8.p() > 0) {
            if (var4 < 0.0F) {
               var132 = zax.a(var9, com.aspose.cells.a.c.zn.a(var127), 0.7F);

               try {
                  var0.a(var132, var127);
               } finally {
                  if (var132 != null) {
                     var132.f();
                  }

               }

               var0.a(var129, var127);
               a(var0, var122, var123, var2, var129);
            } else if (var4 > 0.0F) {
               var132 = zax.a(var9, com.aspose.cells.a.c.zn.a(var127), 0.0F);

               try {
                  var0.a(var132, var126);
               } finally {
                  if (var132 != null) {
                     var132.f();
                  }

               }

               var0.a(var129, var126);
               a(var0, var122, var123, var3, var129);
            } else {
               var132 = zax.a(var9, com.aspose.cells.a.c.zn.a(var127), 0.7F);

               try {
                  var0.a(var132, var126);
               } finally {
                  if (var132 != null) {
                     var132.f();
                  }

               }

               var0.a(var129, var126);
            }
         } else if (var8.p() < 0) {
            if (var4 < 0.0F) {
               var132 = zax.a(var9, com.aspose.cells.a.c.zn.a(var127), 0.0F);

               try {
                  var0.a(var132, var126);
               } finally {
                  if (var132 != null) {
                     var132.f();
                  }

               }

               var0.a(var129, var126);
               a(var0, var122, var123, var3, var129);
            } else if (var4 > 0.0F) {
               var132 = zax.a(var9, com.aspose.cells.a.c.zn.a(var127), 0.7F);

               try {
                  var0.a(var132, var127);
               } finally {
                  if (var132 != null) {
                     var132.f();
                  }

               }

               var0.a(var129, var127);
               a(var0, var122, var123, var2, var129);
            } else {
               var132 = zax.a(var9, com.aspose.cells.a.c.zn.a(var127), 0.0F);

               try {
                  var0.a(var132, var126);
               } finally {
                  if (var132 != null) {
                     var132.f();
                  }

               }

               var0.a(var129, var126);
            }
         } else {
            var0.b(var129, var12.d(), var12.e(), var11.d(), var11.e());
            var0.b(var129, var20.d(), var20.e(), var19.d(), var19.e());
         }

         if (var4 != 0.0F) {
            var0.b(var129, var12.d(), var12.e(), var20.d(), var20.e());
            var0.b(var129, var11.d(), var11.e(), var19.d(), var19.e());
         }
      } finally {
         if (var129 != null) {
            var129.r();
         }

      }

   }

   private static void a(HashMap var0, com.aspose.cells.b.a.b.zo[] var1, com.aspose.cells.b.a.b.zo[] var2, int[] var3, int[] var4) {
      var1[0] = com.aspose.cells.b.a.b.zo.a();
      var2[0] = com.aspose.cells.b.a.b.zo.a();
      var3[0] = 0;
      var4[0] = 0;
      com.aspose.cells.b.a.a.zc var5 = com.aspose.cells.b.a.a.zf.a(var0);

      while(true) {
         com.aspose.cells.b.a.b.zo var6;
         do {
            if (!var5.c()) {
               return;
            }

            var6 = (com.aspose.cells.b.a.b.zo)var5.b();
            if (com.aspose.cells.b.a.b.zo.a(var1[0], com.aspose.cells.b.a.b.zo.a()) || var6.d() > var1[0].d()) {
               var1[0] = var6;
               var3[0] = (Integer)var5.a();
            }
         } while(!com.aspose.cells.b.a.b.zo.a(var2[0], com.aspose.cells.b.a.b.zo.a()) && var6.d() >= var2[0].d());

         var2[0] = var6;
         var4[0] = (Integer)var5.a();
      }
   }

   static void a(zn var0, int var1, int var2, HashMap var3, com.aspose.cells.b.a.b.zm var4) {
      if (var2 > var1) {
         var1 += 360;
      }

      com.aspose.cells.b.a.b.zo[] var5 = new com.aspose.cells.b.a.b.zo[Math.abs(var1 - var2 + 1)];
      zbuk.a(var5);
      int var6 = 0;

      for(int var7 = var2; var7 <= var1; ++var7) {
         var5[var6] = (com.aspose.cells.b.a.b.zo)var3.get(var7 % 360);
         ++var6;
      }

      com.aspose.cells.b.a.b.a.ze var8 = new com.aspose.cells.b.a.b.a.ze();
      var8.c(var5);
      var0.a(var4, var8);
   }
}
